fix: Use the generated pagination dataclass in the paginator - #647
Open
razor-x wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1RzepycXEYA3LStfjt8cY
razor-x
changed the base branch from
main
to
claude/python-sdk-audit-o2iid9-08-cursor-guard
August 28, 2026 00:15
…aude/python-sdk-audit-o2iid9-14-pagination-dataclass
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.
What
Two
Paginationclasses existed: a hand-written one inseam/pagination.pythat the paginator used, and the generated@dataclassinseam/resources/pagination.pythat was exported fromseam.resourcesbut never constructed, imported, or tested anywhere — a dead class shadowing a live one of the same name, and the two disagreed on the null case (SDK audit finding L5a).seam/paginator.pynow hydrates the generated dataclass (via the existingparse_pagination, which supplies the correcthas_next_page=Falsedefault), so the exported resource class is the one callers actually receive and the hand-written duplicate is gone.seam/pagination.pykeepsPaginatedListand re-exportsPaginationso no import path breaks.**/__pycache__alongside**/*_test.py(cheap insurance for a dirty local build; verified the built wheel is clean).Stacked on #641; diff shrinks as the stack merges. Lowest-priority PR of the audit wave — fine to take last.
Testing
New test pins that
seam.pagination.Paginationisseam.resources.Paginationand thatfirst_page()returns an instance of it with correct fields. Wheel contents verified free of__pycache__and*_test.py. Full suite: 236 passed; mypy, pylint (10.00), black clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y1RzepycXEYA3LStfjt8cY
Generated by Claude Code