Nested table models not parsing correctly with pydantic v2 #770
Unanswered
brianmcburney
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
The code sample is runnable against both pydantic v1 and v2.
When a table model is nested inside a BaseModel, it is not parsed correctly with pydantic v2 installed. In the example, the datetime field is a string on the
parsed_table
instance, not a datetime object.In the v1 codepath, the data is parsed here. This doesn't happen in v2 path, possibly because
validate_model
is no longer exported from pydantic?Is this a bug, or should I avoid nesting table models like this going forward?
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.14
Python Version
3.11.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions