Skip to content

Conversation

@mewwts
Copy link
Member

@mewwts mewwts commented Sep 30, 2025

Note

Refactors the async client with built-in retry/backoff and context-managed sessions, adds pagination/CSV utilities, enforces sampling validation, raises HTTP errors for JSON responses, and updates/expands tests.

  • Async Client:
    • Introduces _request with exponential backoff on 429/5xx and ClientError; configurable attempts/statuses.
    • Enforces context-managed sessions (__aenter__/__aexit__), refactors connect/disconnect, and uses default SSL; removes certifi and custom retry exceptions.
    • Updates routing (_route_url) and adds _require_session.
    • Adds _collect_pages pagination helper and _validate_sampling.
    • Improves CSV handling: parse x-dune-next-* headers, cast next_offset to int, read to BytesIO, and release responses.
    • Refresh loop uses terminal states and raises QueryFailedError on failure.
  • Base/Sync:
    • Always call response.raise_for_status() even for JSON responses.
  • Tests:
    • Adds unit tests for pagination, validation, terminal states, CSV parsing, and retry/backoff.
    • E2E tweaks: _session set to None after disconnect; error-path assertions expect HTTPError with status codes.

Written by Cursor Bugbot for commit 81941ff. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@mewwts
Copy link
Member Author

mewwts commented Sep 30, 2025

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

@mewwts mewwts requested a review from bh2smith September 30, 2025 11:06
Copy link
Contributor

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

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

Looks alright. I suppose the tests give a pretty good indication that users won't have to change their code on update.

@mewwts mewwts merged commit cdebf3a into main Oct 2, 2025
2 checks passed
@mewwts mewwts deleted the async branch October 2, 2025 06:54
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.

3 participants