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
I had a copy_on_model_validation flag set to "none" on my pydantic models and could not find any documentation on the migration page on how to deal with this setting in v2. Seems from v1 discussions on issues raised on github that this is now irrelevant since Pydantic will never copy anymore when validating models, also considered by @PrettyWood to be incorrect behaviour.
Could save other people quite some time if this would make it to the pydantic migration docs and/or flagged by bump-pydantic as a superfluous setting now
class DefaultBaseModel(BaseModel):
- class Config:
- arbitrary_types_allowed = True
- copy_on_model_validation = "none"
- validate_assignment = True
+ # TODO: The following keys were removed: `copy_on_model_validation`.
+ # Check https://docs.pydantic.dev/dev-v2/migration/#changes-to-config for more information.
+ model_config = ConfigDict(arbitrary_types_allowed=True, copy_on_model_validation="none", validate_assignment=True)
In the ConfigDict this setting should not even be included anymore, it won't work either I presume.
The text was updated successfully, but these errors were encountered:
I had a copy_on_model_validation flag set to "none" on my pydantic models and could not find any documentation on the migration page on how to deal with this setting in v2. Seems from v1 discussions on issues raised on github that this is now irrelevant since Pydantic will never copy anymore when validating models, also considered by @PrettyWood to be incorrect behaviour.
Could save other people quite some time if this would make it to the pydantic migration docs and/or flagged by bump-pydantic as a superfluous setting now
In the ConfigDict this setting should not even be included anymore, it won't work either I presume.
The text was updated successfully, but these errors were encountered: