-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Mocking Pinecone tests #2778
Mocking Pinecone tests #2778
Conversation
haystack/document_stores/pinecone.py
Outdated
self.pinecone_indexes[index].delete(delete_all=True) | ||
self.pinecone_indexes[index].delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamescalam: the mock did not accept this parameter. As I imagine the mock represents the actual contract with Pinecone, I assumed this might be a leftover from older versions and removed it.
Is that true? If not, I will revert this change and add delete_all
to the mock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete_all
should be included in the mock
@jamescalam: Your mock works really nicely! Thank you so much for it 😊 I have only one test failing that I can't understand well:
I think you should be able to clone this branch and run the test locally to see the issue, otherwise you can see the logs here: https://github.com/deepset-ai/haystack/actions/runs/2634797675 How can I fix the mock to make this test pass? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this line with pass
to fix:
haystack/test/mocks/pinecone.py
Line 90 in f1b3e40
raise ValueError("Namespace not found") |
This aligns with Pinecone where if we query an empty/non-existent namespace in Pinecone it will just return an empty response (not raise a ValueError
)
Sorry, it should be |
@ZanSara the Tests / pinecone-tests-linux error seems valid, I will look at the document store code to fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for Pinecone doc store + mock 😁
Great, thanks! I will merge this as soon as that strange failure with the rest api tests is sorted (we just enabled a new branch protection rule for master and is not going as smoothly as we hoped 😅 ) |
pip install rest_api/ | ||
pip install ui/ | ||
pip install -U rest_api/ | ||
pip install -U ui/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bingo! :)
* Integrating the mock into conftest.py * re-enable workflow * delete_all * Update Documentation & Code Style * remove ValueError * Add empty response * wrong condition * return response * revert removal of delete_all * change mock * Update Documentation & Code Style * test for rest api, to revert Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Related Issue(s): #2644
Proposed changes:
Pre-flight checklist
[ ] If this is a code change, I updated the docstrings