Skip to content

Commit d6e3ca6

Browse files
authored
fix: Pgvector - do not pass null meta to Document.from_dict (#1980)
* fix: rermove None key * chore: fix linting
1 parent abee52a commit d6e3ca6

File tree

1 file changed

+3
-0
lines changed
  • integrations/pgvector/src/haystack_integrations/document_stores/pgvector

1 file changed

+3
-0
lines changed

integrations/pgvector/src/haystack_integrations/document_stores/pgvector/converters.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def _from_pg_to_haystack_documents(documents: List[Dict[str, Any]]) -> List[Docu
5757
haystack_dict["embedding"] = document["embedding"].tolist()
5858
else: # halfvec
5959
haystack_dict["embedding"] = document["embedding"].to_list()
60+
# Document.from_dict expects the meta field to be a a dict or not be present (not None)
61+
if "meta" in haystack_dict and haystack_dict["meta"] is None:
62+
haystack_dict.pop("meta")
6063

6164
haystack_document = Document.from_dict(haystack_dict)
6265

0 commit comments

Comments
 (0)