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

fix: pinecone metadata format #3660

Merged
merged 7 commits into from
Dec 13, 2022

Conversation

jamescalam
Copy link
Contributor

Related Issues

Proposed Changes:

The linked issue is caused by incompatibility for multilevel metadata dictionaries in Pinecone. To fix the issue, I added metadata processing steps to flatten (and 'un-flatten') the metadata dictionaries.

How did you test it?

Using this notebook

Notes for the reviewer

N/A

Checklist

@jamescalam jamescalam requested a review from a team as a code owner December 1, 2022 19:39
@jamescalam jamescalam requested review from ZanSara and removed request for a team December 1, 2022 19:39
@jamescalam jamescalam marked this pull request as draft December 1, 2022 20:25
@jamescalam jamescalam marked this pull request as ready for review December 1, 2022 21:12
@ZanSara
Copy link
Contributor

ZanSara commented Dec 5, 2022

Hello @jamescalam, thank you for this fix! Would you mind adding a few tests in the Pinecone test suite? We have recently improved the test suite and this is a good occasion to add another test. https://github.com/deepset-ai/haystack/blob/main/test/document_stores/test_pinecone.py I'll review the code in the meantime.

haystack/document_stores/pinecone.py Outdated Show resolved Hide resolved
haystack/document_stores/pinecone.py Outdated Show resolved Hide resolved
@jamescalam
Copy link
Contributor Author

jamescalam commented Dec 5, 2022

Hello @jamescalam, thank you for this fix! Would you mind adding a few tests in the Pinecone test suite? We have recently improved the test suite and this is a good occasion to add another test. https://github.com/deepset-ai/haystack/blob/main/test/document_stores/test_pinecone.py I'll review the code in the meantime.

@ZanSara great thanks! I added a new test at the end of the current set of tests. It writes a multilayer metadata dictionary, filters for it, and returns and tests that it is in the same format as when it was added.

Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the test! I left a couple more questions.

haystack/document_stores/pinecone.py Show resolved Hide resolved
test/document_stores/test_pinecone.py Outdated Show resolved Hide resolved
@ZanSara ZanSara changed the title Pinecone metadata format fix: pinecone metadata format Dec 7, 2022
Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 😊

@ZanSara ZanSara added this to the 1.12.0 milestone Dec 13, 2022
@ZanSara ZanSara merged commit 520b23e into deepset-ai:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with classification with PineconeDocumentStore
2 participants