Replies: 1 comment
-
|
I investigated this issue and implemented a solution locally. I added support for the extra parameter in the model_validate and the sqlmodel_validate function since the underlying ExtraBehaviour is already implemented in Core Schema. Also created a test to run a verification covering the issue. Before opening a PR, just wanted to check whether this is the intended approach in this matter. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
The parameter
extrais supported in the pydanticmodel_validate():https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_validate
But that parameter is not supported in sqlmodel due to that method being overridden:
https://github.com/fastapi/sqlmodel/blob/main/sqlmodel/main.py#L873
https://github.com/fastapi/sqlmodel/blob/main/sqlmodel/_compat.py#L276
The
validate_python()method already takesextra, so this should be a simple fix.I can take a look at a PR if that would be helpful.
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.37
Python Version
Python 3.11.14
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions