Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChromaDocumentStore search raise error when document has no metadata #668

Closed
Guest400123064 opened this issue Apr 16, 2024 · 3 comments
Closed
Labels
bug Something isn't working integration:chroma

Comments

@Guest400123064
Copy link

Describe the bug
In ChromaDocumentStore._query_result_to_documents method, line 375, the method tries to convert from chromadb metadatas to Haystack document metadata. It checks if the returned result has any metadata by result.get("metadatas"). This does not actually check if there is any metadata because the returned value will be a nested list, which is always not None. 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):

  • OS: MacOS
  • Haystack version: 2.0.1
  • Integration version: N/A, but as of April 16th 2024, the code on main branch is still causing the reported problem; should be tagged chroma-v0.15.0
@Guest400123064 Guest400123064 added the bug Something isn't working label Apr 16, 2024
@anakin87
Copy link
Member

related to #462 (maybe a dupicate)

@Guest400123064
Copy link
Author

Got it, yea, I think this is indeed a duplicate

@anakin87
Copy link
Member

Closing as it is a duplicate.

@anakin87 anakin87 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration:chroma
Projects
None yet
Development

No branches or pull requests

2 participants