ChromaDocumentStore
search raise error when document has no metadata
#668
Labels
ChromaDocumentStore
search raise error when document has no metadata
#668
Describe the bug
In
ChromaDocumentStore._query_result_to_documents
method, line 375, the method tries to convert fromchromadb metadatas
to Haystack document metadata. It checks if the returned result has any metadata byresult.get("metadatas")
. This does not actually check if there is any metadata because the returned value will be a nested list, which is always notNone
. Then on line 376, if the metadata is actually empty, the second subscription will break.To Reproduce
Simply create a document store with no-metadata documents and try to call
ChromaDocumentStore.search(["test query text"], 1)
. Commenting out the code snippet mentioned above should avoid error (but no metadata in returned documents)Describe your environment (please complete the following information):
main
branch is still causing the reported problem; should be taggedchroma-v0.15.0
The text was updated successfully, but these errors were encountered: