Replies: 2 comments
-
I see 0.0.10 bumps minimum Pydantic to 1.9, so I guess pinning Pydantic < 1.9 is no longer an option. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Problem remains in 0.0.12. |
Beta Was this translation helpful? Give feedback.
0 replies
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
Pydantic 1.9 added
none
/shallow
/deep
as options forpydantic.config.BaseConfig.copy_on_model_validation
. Before that, it was a bool.pydantic/pydantic@47362e3
SQLModel checks it as if it were a boolean in main.py:
https://github.com/tiangolo/sqlmodel/blob/d05c3ee495bb81d2915b38052ac5f1909da60e37/sqlmodel/main.py#L596
Because
copy_on_model_validation
is a str now, this will always return True.Ideas for solutions:
return value.copy() if cls.__config__.copy_on_model_validation != "none" else value
Pin Pydantic dependency to <1.9Looks to me like Pydantic broke compatibility without incrementing the major version, but this would fix it, and it looks like 1.8.2 is still compatible with FastAPI.copy_on_model_validation
to None even though that isn't a valid value per Pydantic's type hintsThoughts? More than happy to create a PR you think this needs fixing!
Operating System
Linux
Operating System Details
Fedora 38
SQLModel Version
0.0.9, 0.0.10, 0.0.12
Python Version
3.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions