You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manipulating any Pydantic model type from a state raise a library error pydantic_core._pydantic_core.PydanticSerializationError: ... 'ImmutableMutableProxy' object cannot be converted to 'PyDict'.
To reproduce
Define two Pydantic v2 models, A and B, B a child if the first
Assign B to the app state as b: B = B()
Execute TypeAdapter(A).dump_json(self.b)
See the error
Expected behavior
Any manipulation of a Pydantic model inside the state work like it should out of the state.
Context
Python version: v3.13
Reflex version: v0.7.0
Pydantic version: v2.10.6
OS: Debian Bookworm
Browser (Optional): n/a
The text was updated successfully, but these errors were encountered:
Maybe test in ImmutableMutableProxy.__dict__ method override the caller package and return the original response with super().__dict__ instead of the wrapper? Hacky and not a good practice, but it should work out of the box and kept simple.
Describe the bug
Manipulating any Pydantic model type from a state raise a library error
pydantic_core._pydantic_core.PydanticSerializationError: ... 'ImmutableMutableProxy' object cannot be converted to 'PyDict'
.To reproduce
A
andB
,B
a child if the firstB
to the app state asb: B = B()
TypeAdapter(A).dump_json(self.b)
Expected behavior
Any manipulation of a Pydantic model inside the state work like it should out of the state.
Context
The text was updated successfully, but these errors were encountered: