diff --git a/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py b/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py index d39158db4..5be6a7938 100644 --- a/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py +++ b/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py @@ -428,8 +428,9 @@ def _query_result_to_documents(result: QueryResult) -> List[List[Document]]: } # prepare metadata - if metadatas := result.get("metadatas"): - document_dict["meta"] = dict(metadatas[i][j]) + metadatas = result.get("metadatas") + if metadatas and metadatas[i][j] is not None: + document_dict["meta"] = metadatas[i][j].copy() if embeddings := result.get("embeddings"): document_dict["embedding"] = np.array(embeddings[i][j])