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

Feature/fix get all #192

Merged
merged 3 commits into from
Mar 21, 2024
Merged

Feature/fix get all #192

merged 3 commits into from
Mar 21, 2024

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Mar 21, 2024

Ellipsis 🚀 This PR description was created by Ellipsis for commit be51194.

Summary:

The pull request modifies the get_all_unique_values function in the PGVectorDB class to use the query method of the collection object to retrieve all records, extract unique values from the metadata_field, and return them as a list.

Key points:

  • Modified the get_all_unique_values function in the PGVectorDB class in /r2r/vector_dbs/pg_vector/base.py.
  • The function now uses the query method of the collection object to retrieve all records.
  • An empty vector is passed as the data argument to the query method.
  • The limit argument is removed to retrieve all records.
  • The unique values are extracted from the metadata_field of the records and returned as a list.

Generated with ❤️ by ellipsis.dev

@emrgnt-cmplxty emrgnt-cmplxty merged commit ab0b072 into main Mar 21, 2024
1 of 2 checks passed
Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
r2r-docs 🔄 Building (Inspect) Visit Preview Mar 21, 2024 5:48am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested.

  • Reviewed the entire pull request up to be51194
  • Looked at 38 lines of code in 1 files
  • Took 50 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 0 additional comments because they didn't meet confidence threshold of 50%.

Workflow ID: wflow_B5Z4ZMmKCg4NwwCL


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.

def get_all_unique_values(
self, metadata_field: str, filters: dict = {}
) -> list:
def get_all_unique_values(self, metadata_field: str, filters: dict = {}) -> list:
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using pagination or limiting the number of records retrieved at once to avoid potential performance issues with large collections. Also, avoid using mutable default arguments. Instead, use None and set the default in the function body.

Suggested change
def get_all_unique_values(self, metadata_field: str, filters: dict = {}) -> list:
def get_all_unique_values(self, metadata_field: str, filters: dict = None) -> list:
if filters is None:
filters = {}

@emrgnt-cmplxty emrgnt-cmplxty deleted the feature/fix-get-all branch March 21, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant