Skip to content

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

Merged
razor-x merged 1 commit into
mainfrom
claude/python-sdk-audit-o2iid9-14-pagination-dataclass
Aug 28, 2026
Merged

fix: Use the generated pagination dataclass in the paginator#647
razor-x merged 1 commit into
mainfrom
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
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from 4871090 to cf3aa9b Compare August 28, 2026 19:30
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from cf3aa9b to cbc7255 Compare August 28, 2026 20:36
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from cbc7255 to 6005761 Compare August 28, 2026 20:43
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from 6005761 to c2910c2 Compare August 28, 2026 21:04
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from c2910c2 to 6496775 Compare August 28, 2026 21:09
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from 6496775 to 5ed520d Compare August 28, 2026 21:12
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from 5ed520d to 722cc63 Compare August 28, 2026 21:17
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from 722cc63 to f94d7b5 Compare August 28, 2026 21:29
Base automatically changed from claude/python-sdk-audit-o2iid9-08-cursor-guard to main August 28, 2026 21:40
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from f94d7b5 to ec2b6d5 Compare August 28, 2026 21:40
@razor-x
razor-x force-pushed the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch from ec2b6d5 to 8018863 Compare August 28, 2026 21:42
@razor-x
razor-x merged commit 086e62f into main Aug 28, 2026
23 checks passed
@razor-x
razor-x deleted the claude/python-sdk-audit-o2iid9-14-pagination-dataclass branch August 28, 2026 22:07
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