Open lolliuym opened 1 year ago
the tips below didn't help:
To resolve this issue, you have a few options:
Update Pydantic: Make sure you have the latest version of Pydantic installed. You can use pip install --upgrade pydantic to upgrade to the latest version.
Replace @root_validator with @model_validator: As mentioned in the error message, @root_validator is deprecated and should be replaced with @model_validator. Update your code to use @model_validator instead.
Specify skip_on_failure=True: If you want to continue using @root_validator, you can add the skip_on_failure=True parameter to the decorator. This will prevent the error from occurring. For example:
@root_validator(pre=False, skip_on_failure=True) def my_validator(cls, values):
return values
Someone please help me in fixing this.
Thanks in advance :).
I keep getting the same error. Does anyone have a solution please?
Use pydantic following version Pydantic==1.10.7
I fixed this issue by using below command to install pydantic.
pip install pydantic==1.10.7
The error message you're seeing indicates that there is an issue with the usage of the @root_validator decorator from the Pydantic library. Starting from version 2.0.2, if you use @root_validator with pre=False (which is the default behavior), you must specify skip_on_failure=True to avoid this error.
File containing root_validator not found !