Repository navigation
Conversation
Member
This was referenced Nov 17, 2026
Mamut446
added a commit
to Mamut446/sdk-python
that referenced
this pull request
Nov 17, 2026
…with an invalid cursor Adopt the bounded export iterator from prooflinedev#27 unchanged, rebased on current main: the continuation cursor is validated before its page is yielded, and max_pages rejects booleans and non-integers. Take prooflinedev#27's tests in place of this branch's. Add a regression for sync and async clients asserting that the page carrying an empty, resumed, repeated or cyclic cursor is never yielded. Co-authored-by: AI1120 <133474218+AI1120@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V9GvJaWFKxjgK1vyZ27mhr
Member
|
Codex: Superseded by merged #52, which adopts this implementation and credits your contribution. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Engineers exporting analytics currently have to maintain their own continuation loop around export_reviews. Add iter_export_pages to both client facades so they can consume CSV or NDJSON exports one page at a time while preserving the organization, dataset, time window, format, grouping, and optional starting cursor.
The iterator reuses the existing bounded transport and export decoder. It yields ExportPage objects so callers retain raw text, decoded rows, dataset version, and settled horizon. It follows cursors even when an intermediate page is empty, rejects empty or repeated continuation cursors before yielding that page, and raises pagination-limit if max_pages is exhausted while continuation remains. The default limit is 100 pages, configurable from 1 to 1000. Requests happen only when the consumer advances the iterator.
The existing single-page method and API contract remain unchanged. The contract checker recognizes the new facade helper. The README includes a streaming example and error behavior.
Verification:
HTTP tests cover sync/async behavior, CSV/NDJSON, lazy fetching, resumed cursors, exact filter preservation, empty intermediate pages, normal completion at the configured bound, invalid page limits, repeated and cyclic cursors, and an API refusal without pagination retries.
Implementation and verification performed with AI coding assistance.