Repository navigation
fix: raise clear error for unserialized properties on dataclass and Pydantic vars - #7648
somiljain2006 wants to merge 6 commits into
Conversation
[Medium impact] The latest change appears safe to merge; it preserves the explicit SummaryThe PR rejects plain properties omitted from serialized Pydantic models and dataclasses while preserving computed fields and custom model serializers.
Reviews (4) · Last reviewed commit: "Update tests/units/vars/test_object.py" · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
All Submissions:
Type of change
New Feature Submission:
Changes To Core Features:
Description
This change prevents plain Python properties on Pydantic models and dataclasses from being treated as accessible Reflex Vars when those properties are not included in the serialized output. Accessing such properties could generate a frontend reference to a value that does not exist in the serialized object, resulting in
undefinedat runtime.The change provides a clear error for unsupported properties while preserving access to declared fields and Pydantic
computed_fieldvalues. Regression tests cover both Pydantic models and dataclasses.Closes #7633