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

Move Python SDK to Objects #1939

Merged
merged 48 commits into from
Feb 7, 2025
Merged

Move Python SDK to Objects #1939

merged 48 commits into from
Feb 7, 2025

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Feb 5, 2025

Important

Transition Python SDK to object-oriented responses, updating methods and tests to handle new response objects across documents, users, and retrieval operations.

  • SDK Changes:
    • Transition to object-oriented responses across the SDK, affecting documents, users, retrieval, indices, graphs, and conversations.
    • Update methods to return specific response objects like WrappedDocumentResponse, WrappedUserResponse, etc.
    • Modify ingestion, retrieval, and user management functions to align with new response handling.
  • Test Updates:
    • Update integration tests to use new response objects and verify correct behavior.
    • Ensure tests cover all major functionalities including document ingestion, user operations, and retrieval queries.
    • Add tests for error handling and edge cases, such as invalid inputs and unauthorized access.
  • Miscellaneous:
    • Remove deprecated or unused code paths.
    • Improve error messages and logging for better debugging.

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

@NolanTrem NolanTrem marked this pull request as ready for review February 7, 2025 01:25
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 b370f9d in 4 minutes and 57 seconds

More details
  • Looked at 10476 lines of code in 58 files
  • Skipped 0 files when reviewing.
  • Skipped posting 10 drafted comments based on config settings.
1. tests/integration/test_chunks.py:80
  • Draft comment:
    Using a fixed sleep (5s) to wait for ingestion might lead to flaky tests under load. Consider polling for status until the document is ingested.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. tests/integration/test_chunks.py:173
  • Draft comment:
    Good practice: the unauthorized access test cleanly instantiates a new client & checks for 403. Make sure your backend consistently enforces permissions.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. tests/integration/test_chunks.py:239
  • Draft comment:
    The pagination tests are straightforward. Consider adding edge-case tests (e.g., offset=0 with fewer results) to further validate your pagination logic.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
4. py/tests/unit/test_chunks.py:81
  • Draft comment:
    Consider increasing the sleep time during document ingestion (currently 5 seconds) only if necessary. Using async polling (or a retry mechanism) might reduce test flakiness.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
5. py/tests/integration/test_retrieval.py:143
  • Draft comment:
    For consistency, use the '.results' attribute rather than dictionary key access (e.g. using resp.results instead of resp["results"]).
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. py/tests/integration/test_ingestion.py:89
  • Draft comment:
    The polling loop for ingestion status works correctly, but adding a brief log (or comment) about breaking on failure may improve debuggability in case of failures.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
7. py/tests/integration/test_users.py:142
  • Draft comment:
    Ensure that after user registration and login, the tests properly log out the user to avoid side effects between tests.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
8. py/tests/integration/test_filters.py:115
  • Draft comment:
    The filter tests correctly cast collection IDs to strings ensuring type consistency when comparing UUIDs. This is good practice for cross-system compatibility.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
9. py/tests/integration/test_graphs.py:150
  • Draft comment:
    Tests in the graphs module appropriately test functionality (e.g., create, update, list entities) and consistently compare string representations of IDs.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
10. py/tests/integration/test_ingestion.py:310
  • Draft comment:
    Tests for document ingestion (file, raw text, chunks, etc.) are comprehensive. Consider adding more comments to guide future maintainers through the ingestion process logic.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None

Workflow ID: wflow_YqNh0do0omnoOtIi


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

@NolanTrem NolanTrem merged commit 5abf1b0 into main Feb 7, 2025
15 checks passed
@NolanTrem NolanTrem deleted the Nolan/ReturnObjects branch February 7, 2025 02:40
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