feat(low-code): expose stream_slice to the paginator interpolation context - #1174
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Conversation
…context Pass the slice being read through `SimpleRetriever` and `DefaultPaginator` into `PaginationStrategy.next_page_token`, and add it (with the `stream_interval` / `stream_partition` aliases) to the context of `CursorPagination.stop_condition` and `cursor_value`. Paginators and strategies defined outside the CDK are only handed the slice when their `next_page_token` declares `stream_slice` or `**kwargs`, so existing custom strategies keep working unchanged. Closes #1166 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@tolik0/cdk/paginator-stream-slice#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch tolik0/cdk/paginator-stream-slicePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Contributor
Author
|
/prerelease
|
2 tasks
Anatolii Yatsuk (tolik0)
added a commit
to airbytehq/airbyte
that referenced
this pull request
Sep 23, 2026
…-cdk#1174 prerelease Pin `airbyte-cdk` to `7.30.0.post1.dev35881419701` until #1174 is released, and fill in the changelog PR number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Closes #1166.
What
CursorPagination.stop_conditionandcursor_valuecan now read the slice being paginated, asstream_slice,stream_intervalorstream_partition, the same aliases the requester already offers.Until now a stop condition that depends on the slice (stop once the page is older than the window start) needed a custom
PaginationStrategy, and the slice had to reach it through a side channel. source-github did this by sending the window start in anX-Airbyte-Window-Startrequest header and reading it back off the prepared request (review thread).How
PaginationStrategy.next_page_tokenandPaginator.next_page_tokentake an optionalstream_slice.SimpleRetriever/LazySimpleRetrieverpass the slice each page was read for, including after a pagination reset, throughDefaultPaginator,PaginatorTestReadDecoratorandStopConditionPaginationStrategyDecoratordown to the strategy.CursorPaginationStrategyadds it to the interpolation context ofstop_conditionandcursor_value. The built-inOffsetIncrement,PageIncrementandNoPaginationaccept and ignore it.Backward compatibility
Custom paginators and strategies in connectors override
next_page_token(self, response, last_page_size, last_record, last_page_token_value)without the new parameter.stream_slice_kwargsonly passesstream_slicewhen the callee's signature declaresstream_sliceor**kwargs(cached per function), so those keep working unchanged. This follows the signature-gating used forpage_size_overridein #1149.Tests
CursorPaginationStrategy: a slice-dependentstop_conditionover fresh, stale and empty pages, and acursor_valueread fromstream_partition.DefaultPaginator, the test-read decorator andStopConditionPaginationStrategyDecorator: the slice is forwarded, and a strategy without the parameter is not handed it.SimpleRetriever: after a pagination reset, the paginator sees the slice each page was read for; a paginator without the parameter keeps working.unit_tests/sources/declarative: 2085 passed. ruff and mypy clean.Adopter
airbytehq/airbyte source-github replaces
WorkflowRunsPaginationStrategyand theX-Airbyte-Window-Startheader with astop_condition(PR to follow, pinned to a prerelease of this branch).🤖 Generated with Claude Code