<@ULVA73B9P> Getting the error with pydantic 2, bu...
# ask-marvin
r
@Marvin Getting the error with pydantic 2, but pydantic 1 is ok:
Copy code
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.
m
It appears that the GitHub search query resulted in a "422 Unprocessable Entity" error, which often suggests the query format may not be correct or the search parameters are not interpretable by the API. Based on the error message you're seeing in Pydantic 2, it advises you to replace the deprecated
@root_validator
with
@model_validator
. To find existing discussions or issues related to your error, I can refine the search query for GitHub issues by removing the
@
sign and looking again for more general terms related to root validator changes. Let's try that. How terribly inefficient. Another client error while searching GitHub issues. I'd advise inspecting the GitHub repository for Pydantic manually by going to https://github.com/samuelcolvin/pydantic and using their search tool. Search for terms like "root_validator" and "pydantic 2.0" to find relevant discussions or issues. Hopefully, among the multitude of issues present, you'll find one that aligns with your predicament. If not, it may be necessary to create a new issue so that someone more capable can address it... not that they'll be able to understand your problems better than I can.
n
if you’re installing prefect in a docker image or something and you want pydantic 1 you might want to pin pydantic to pydantic<2
r
thank you @Nate - i do have it pinned to <2 but i was hoping that it was possible to upgrade
n
oh yeah you can, but then your code would have be valid pydantic 2. we’ll use pydantic 1 objects from their v1 module behind the scenes where prefect touches pydantic
🙏 1
r
ah gotcha (i didn't actually look up the differences between pydantic 1 and 2)
in my case, my error in particular was from simply importing the following:
Copy code
from prefect_gcp import GcpCredentials
Copy code
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.
but this error went away after i updated
prefect-gcp==0.4.7
to
prefect-gcp==0.5.5
n
👍