Skip to content

scan_items/scan_values honour a reader subclass overriding __iter__/__getitem__ (#9) - #11

Merged
thorwhalen merged 2 commits into
masterfrom
fix-9-scan-honours-overrides
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
masterfrom
fix-9-scan-honours-overrides

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Fixes #9. The single-scan fast path is taken only when type(store) does not override __iter__/__getitem__ outside the dynamodol package (MRO owner check); otherwise scan_items/scan_values delegate to .items()/.values(), which honour the override. dynamodol's own subclasses (prefix, partition, query readers, persisters) keep the fast path. Mocks only.

Adversarial review (fresh Opus, ~35 experiments): verdict merge. Applied its suggestions: tolerate __module__ = None, and the docstring says only those two overrides are detected. Not changed (judged acceptable): a subclass defining items = scan_items plus an override now recurses loudly instead of silently returning unmapped values; overrides of _scan_records/items() are not detected.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 13, 2026 15:25
…ubclass overriding __iter__/__getitem__ (#9)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tected (#9 review)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 49e5f1b into master Oct 13, 2026
10 checks passed
@thorwhalen
thorwhalen deleted the fix-9-scan-honours-overrides branch October 13, 2026 15:30
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.

scan_items/scan_values take the raw single-scan path for a DynamoDbBaseReader subclass that overrides __iter__/__getitem__

1 participant