This repository was archived by the owner on Oct 2, 2026. It is now read-only.
Repository navigation
Fix update_dataclass_from_json for None/frozen nested dataclasses - #1403
Merged
Merged
Conversation
_recursive_update_dataclass_from_json_obj rebuilt a nested dataclass field by recursing into whatever the attribute currently held. That breaks for a field typed `X | None` holding `None` (nothing to recurse into, raises "Unhandled stateclass deserialization") and for a frozen nested dataclass (setattr raises FrozenInstanceError). Both cases surface inside update_state, before any event handler runs, so the interaction silently does nothing. Build nested dataclass values (including list items) directly from the JSON payload via the constructor, resolving `X | None` to `X` from the type hint, instead of instantiating empty and mutating with setattr. Fixes #1401 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019XKNGzaycAUrysh8HgHpPX
Collaborator
Author
|
The I don't have permission to trigger a re-run from here (got a 403 on the rerun-failed-jobs API). Flagging so a maintainer can re-run the job; I'll keep watching this PR for further CI/review activity. Generated by Claude Code |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
_recursive_update_dataclass_from_json_obj rebuilt a nested dataclass field
by recursing into whatever the attribute currently held. That breaks for a
field typed
X | NoneholdingNone(nothing to recurse into, raises"Unhandled stateclass deserialization") and for a frozen nested dataclass
(setattr raises FrozenInstanceError). Both cases surface inside
update_state, before any event handler runs, so the interaction silently
does nothing.
Build nested dataclass values (including list items) directly from the
JSON payload via the constructor, resolving
X | NonetoXfrom thetype hint, instead of instantiating empty and mutating with setattr.
Fixes #1401
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_019XKNGzaycAUrysh8HgHpPX