BUGFIX: redis vector store overwrites falsey metadata (#13652)

- **Description:** This commit fixed the problem that Redis vector store
will change the value of a metadata from 0 to empty when saving the
document, which should be an un-intended behavior.
  - **Issue:** N/A
  - **Dependencies:** N/A
This commit is contained in:
dandanwei 2023-11-22 05:16:23 +01:00 committed by GitHub
parent a21e84faf7
commit d47ee1ae79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1381,7 +1381,7 @@ def _prepare_metadata(metadata: Dict[str, Any]) -> Dict[str, Any]:
clean_meta: Dict[str, Union[str, float, int]] = {}
for key, value in metadata.items():
if not value:
if value is None:
clean_meta[key] = ""
continue