diff --git a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py index 0abaaecce..097e86c7e 100644 --- a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py +++ b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py @@ -409,7 +409,7 @@ def _from_pg_to_haystack_documents(self, documents: List[Dict[str, Any]]) -> Lis # postgresql returns the embedding as a string # so we need to convert it to a list of floats - if "embedding" in document and document["embedding"]: + if document.get("embedding"): haystack_dict["embedding"] = [float(el) for el in document["embedding"].strip("[]").split(",")] haystack_document = Document.from_dict(haystack_dict)