Skip to content

fix: Use the generated pagination dataclass in the paginator - #647

Open
razor-x wants to merge 2 commits into
claude/python-sdk-audit-o2iid9-08-cursor-guardfrom
claude/python-sdk-audit-o2iid9-14-pagination-dataclass
Open

fix: Use the generated pagination dataclass in the paginator#647
razor-x wants to merge 2 commits into
claude/python-sdk-audit-o2iid9-08-cursor-guardfrom
claude/python-sdk-audit-o2iid9-14-pagination-dataclass

Conversation

@razor-x

@razor-x razor-x commented Aug 27, 2026

Copy link
Copy Markdown
Member

What

Two Pagination classes existed: a hand-written one in seam/pagination.py that the paginator used, and the generated @dataclass in seam/resources/pagination.py that was exported from seam.resources but 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.py now hydrates the generated dataclass (via the existing parse_pagination, which supplies the correct has_next_page=False default), so the exported resource class is the one callers actually receive and the hand-written duplicate is gone. seam/pagination.py keeps PaginatedList and re-exports Pagination so no import path breaks.
  • Folds in the audit's L9 remnant: the wheel/sdist excludes gain **/__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.Pagination is seam.resources.Pagination and that first_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

@razor-x
razor-x requested a review from a team as a code owner August 27, 2026 22:05
@razor-x
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
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.

2 participants