-
Notifications
You must be signed in to change notification settings - Fork 210
feat: add metadata exploration methods to MongoDBAtlasDocumentStore #2820
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
Open
Amanbig
wants to merge
6
commits into
deepset-ai:main
Choose a base branch
from
Amanbig:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+602
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Implement [count_documents_by_filter](cci:1://file:///c:/Users/ROGST/Documents/Programming/python/haystack-core-integrations/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py:1537:4-1550:72) - Implement [count_unique_metadata_by_filter](cci:1://file:///c:/Users/ROGST/Documents/Programming/python/haystack-core-integrations/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py:1624:4-1664:9) - Implement [get_metadata_fields_info](cci:1://file:///c:/Users/ROGST/Documents/Programming/python/haystack-core-integrations/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py:1710:4-1741:28) (using sample-based inference) - Implement [get_metadata_field_min_max](cci:1://file:///c:/Users/ROGST/Documents/Programming/python/haystack-core-integrations/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py:421:4-447:48) - Implement [get_metadata_field_unique_values](cci:1://file:///c:/Users/ROGST/Documents/Programming/python/haystack-core-integrations/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py:449:4-491:48) - Add async counterparts for all new methods - Add integration tests for new functionality
- Implement count_documents_by_filter (renamed ilter arg to ilters to fix shadowing) - Implement count_unique_metadata_by_filter - Implement get_metadata_fields_info - Implement get_metadata_field_min_max - Implement get_metadata_field_unique_values (uses e.escape for safety) - Add async counterparts - Fix docstring line lengths and formatting
...ions/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py
Show resolved
Hide resolved
Contributor
|
The following methods need to be implemented
|
Author
|
Thanks for the review, @davidsbatista! I’ll also go ahead and implement the remaining async methods:
Will push the updates shortly. |
- implemented get_metadata_fields_info_async, get_metadata_field_min_max_async, and get_metadata_field_unique_values_async - refactored synchronous methods to use shared helper functions - added unit tests for new async methods
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Planned Work
Implement
count_documents_by_filter(following the behavior of
OpenSearchDocumentStore)Implement
count_unique_metadata_by_filter(aligned with existing implementations in other document stores)
Implement
get_metadata_fields_info(using sample-based inference, similar to OpenSearch)
Implement
get_metadata_field_min_maxImplement
get_metadata_field_unique_values(consistent with the MongoDB implementation in add the following operations to
MongoDBDocumentStore#2640)Add async counterparts for all new methods
Add integration tests for the new functionality
Related Issues
MongoDBDocumentStore#2640Proposed Changes
This work adds missing metadata and aggregation operations to
MongoDBDocumentStore, bringing it in line with other Haystack document stores.The implementation follows patterns already used in OpenSearch and MongoDB integrations to keep behavior consistent across backends.
How Did You Test It?
Notes for the Reviewer
MongoDBDocumentStore#2640 where applicableChecklist
feat:)