Repository navigation
REST: Send an empty pageToken on the first paginated request - #4511
Merged
Merged
Conversation
When rest-page-size is set, the first list request sent pageSize without pageToken, so servers returned all results in one response or failed. Send an empty pageToken to opt in to pagination, and keep blank query values when signing with SigV4.
Fokko
reviewed
Nov 29, 2026
Match the Java client by sending pageToken= on the first request even when rest-page-size is unset, so servers paginate with their default page size instead of returning everything in one response. Parametrize the pagination test over namespaces, tables, and views, and assert the canonical query string that gets signed so a blank pageToken cannot be dropped from the signature.
Fokko
approved these changes
Nov 30, 2026
Fokko
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for aligning this with Java
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.
Rationale for this change
Closes #4096.
When
rest-page-sizeis set,list_namespaces,list_tables, andlist_viewssentpageSizewithoutpageTokenon the first request. The REST spec says a request withoutpageTokenreturns all results in one response, so compliant servers ignoredrest-page-size, and some servers failed with aNumberFormatException.The first request now always sends an empty
pageTokento opt in to pagination, even whenrest-page-sizeis not set, matching the Java client and letting the server use its default page size. Blank query values are kept when signing with SigV4 so the signed query matches the request that is sent.Are these changes tested?
Yes. Updated the existing page size tests and added coverage for the first and subsequent pages, plus a SigV4 test that checks the blank
pageTokensurvives signing.tests/catalog/test_rest.pypasses with 201 tests, anduv run prek run --files pyiceberg/catalog/rest/__init__.py tests/catalog/test_rest.pypasses.Are there any user-facing changes?
No API changes. Pagination now works when
rest-page-sizeis configured.