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

Nolan/collections migration #1681

Merged
merged 3 commits into from
Dec 10, 2024
Merged

Nolan/collections migration #1681

merged 3 commits into from
Dec 10, 2024

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Dec 10, 2024

Important

Add user and document count columns to collections and update handlers to maintain counts, plus Docker Compose changes for statement cache size.

  • Database Changes:
    • Add user_count and document_count columns to collections table in migration c45a9cf6a8a4_add_user_and_document_count_to_.py.
    • Update PostgresCollectionHandler in collection.py to maintain user_count and document_count during collection updates and assignments.
    • Update PostgresUserHandler in user.py to maintain user_count in collections when users are added or removed.
  • Docker Compose:
    • Add R2R_POSTGRES_STATEMENT_CACHE_SIZE environment variable to compose.yaml and compose.full.yaml.

This description was created by Ellipsis for b5adb16. It will automatically update as commits are pushed.

@NolanTrem NolanTrem marked this pull request as ready for review December 10, 2024 21:56
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.

👍 Looks good to me! Reviewed everything up to b5adb16 in 29 seconds

More details
  • Looked at 194 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. py/compose.full.yaml:297
  • Draft comment:
    Consider documenting the new environment variable R2R_POSTGRES_STATEMENT_CACHE_SIZE for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces a new environment variable R2R_POSTGRES_STATEMENT_CACHE_SIZE in both compose.full.yaml and compose.yaml. This should be documented in the PR description or comments for clarity.
2. py/compose.yaml:69
  • Draft comment:
    Consider documenting the new environment variable R2R_POSTGRES_STATEMENT_CACHE_SIZE for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces a new environment variable R2R_POSTGRES_STATEMENT_CACHE_SIZE in both compose.full.yaml and compose.yaml. This should be documented in the PR description or comments for clarity.
3. py/core/providers/database/collection.py:347
  • Draft comment:
    Consider using a logger for timing information instead of print statements if debugging is needed.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR removes timing debug prints from get_collections_overview method. This is a good change for production code, but if these were needed for debugging, consider using a logger instead.
4. py/core/providers/database/collection.py:417
  • Draft comment:
    Ensure similar logic for updating document_count is applied when removing documents from collections.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR adds an update to the document_count in the assign_document_to_collection_relational method. This is a good addition for maintaining accurate counts, but ensure that similar logic is applied when removing documents from collections.
5. py/core/providers/database/user.py:393
  • Draft comment:
    Ensure similar logic for updating user_count is applied when removing users from collections.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR adds an update to the user_count in the add_user_to_collection method. This is a good addition for maintaining accurate counts, but ensure that similar logic is applied when removing users from collections.

Workflow ID: wflow_c8J2NLXKLofXL7Bm


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 245b622 into main Dec 10, 2024
1 of 19 checks passed
@NolanTrem NolanTrem deleted the Nolan/CollectionsMigration branch December 10, 2024 21:57
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