Skip to content

fix(records): point at as_id() when delete receives records - #2750

Draft
andersfylling wants to merge 2 commits into
masterfrom
fix/records-delete-identifiers
Draft

fix(records): point at as_id() when delete receives records#2750
andersfylling wants to merge 2 commits into
masterfrom
fix/records-delete-identifiers

Conversation

@andersfylling

Copy link
Copy Markdown
Contributor

Handing delete() the records you just fetched is a plausible mistake, and the error points at SDK internals instead of at the conversion you need:

records = client.data_modeling.records.filter(stream_id=STREAM_ID)
client.data_modeling.records.delete(records, stream_id=STREAM_ID)
# AttributeError: 'Record' object has no attribute 'as_dict'

RecordIdSequence.load now checks what it was given and raises TypeError naming RecordId and the as_id() / as_ids() conversions. Same for a list of dicts or a bare external-id string.

First commit is the failing tests, second is the fix.

🤖 Generated with Claude Code

andersfylling and others added 2 commits August 7, 2026 01:00
…bute

Handing delete() the records you just fetched is a plausible mistake, and the
resulting "AttributeError: Record object has no attribute as_dict" points at
SDK internals rather than at as_id()/as_ids().

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
RecordIdSequence.load now checks what it was handed and raises TypeError naming
RecordId and the as_id()/as_ids() conversions, instead of letting a Record, a
dict or a plain string reach as_dict() and fail as an AttributeError.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant