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

Patch/fix filtered deletion logic #1677

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Dec 10, 2024

Important

Fix document deletion logic and update SDK tests, including new integration tests for document operations.

  • Behavior:
    • Fixes document deletion logic in delete_document_by_id() in documents_router.py by changing filter key from id to document_id.
    • Updates _make_request() in async_client.py to handle non-JSON responses by returning BytesIO for binary content.
  • Testing:
    • Removes run-cli-ingestion-tests and run-sdk-ingestion-tests actions.
    • Adds run-sdk-documents-tests action to test SDK document operations.
    • Introduces runner_documents.py for integration tests covering document creation, retrieval, deletion, and more.
  • Misc:
    • Bumps version in pyproject.toml from 3.3.7 to 3.3.8.

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

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review December 10, 2024 01:12
@emrgnt-cmplxty emrgnt-cmplxty merged commit 3eec40a into main Dec 10, 2024
1 of 16 checks passed
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 everything up to c25dbb0 in 1 minute and 51 seconds

More details
  • Looked at 2719 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. py/core/main/api/v3/documents_router.py:1107
  • Draft comment:
    The filter key was changed from id to document_id, which is likely the correct field for identifying documents in the database. This change ensures that the deletion operation targets the correct documents.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. py/sdk/async_client.py:76
  • Draft comment:
    The _make_request method now checks for application/json in the response headers and returns a BytesIO object for non-JSON content. This change ensures proper handling of binary data.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. py/sdk/v3/documents.py:151
  • Draft comment:
    The download method now expects a BytesIO response, which aligns with the updated _make_request method in async_client.py to handle binary content correctly.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_y4x2x5U55ghd9hrY


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

from r2r import R2RClient, R2RException


def compare_result_fields(result, expected_fields):
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is identical to the existing one - consider reusing it instead of duplicating.

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