Mitch
01/27/2025, 9:00 PMpydantic.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`.
Tried reverting back to pydantic 1.10.11 as that's what we has used in the past.
And because prefect (3.1.11) depends on pydantic (>=2.7,<2.10.0 || >2.10.0,<3.0.0)
and prefect (3.1.13) depends on pydantic (>=2.9,<2.10.0 || >2.10.0,<3.0.0), prefect (>=3.0,<3.1.12 || >3.1.12,<3.1.14 || >3.1.14,<4.0) requires pydantic (>=2.7,<3.0.0).
And because prefect (3.1.14) depends on pydantic (>=2.9,<2.10.0 || >2.10.0,<3.0.0)
and prefect (3.1.12) depends on pydantic (>=2.7,<2.10.0 || >2.10.0,<3.0.0), prefect (>=3.0,<4.0) requires pydantic (>=2.7,<3.0.0).
Reverting to prefect 2.20.X I get the following for any prefect cli or run.
pydantic.v1.error_wrappers.ValidationError: 1 validation error for Profile
settings
Unknown setting 'PREFECT_SERVER_ALLOW_EPHEMERAL_MODE'. (type=value_error)
Marvin
01/27/2025, 9:00 PMMitch
01/27/2025, 9:01 PMpydantic.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`.
Marvin
01/27/2025, 9:01 PM@root_validator
decorator in Pydantic 2.x. The error message suggests using @model_validator
instead. Prefect 3.x has moved towards supporting Pydantic 2.x, which means you'll need to adapt your code accordingly.
Here's what you can do:
1. Replace @root_validator
with `@model_validator`: Update your Pydantic models to use @model_validator
for validation. This change is necessary because @root_validator
is deprecated in Pydantic 2.x.
2. Ensure Compatibility: If you have custom Pydantic models that interact with Prefect, ensure they are compatible with Pydantic 2.x. The Prefect documentation suggests referring to Pydantic’s migration guide for detailed information on necessary changes. Pydantic Migration Guide.
3. Prefect and Pydantic Integration: For Prefect 3.x, custom validation should be explicitly handled in your flow. You can find more information on how to handle custom validation in Prefect's documentation.
If you continue to face issues, consider checking Prefect's GitHub repository for any related issues or solutions. A recent pull request has moved several validators to an internal module to address these deprecations. You might want to keep an eye on Prefect's GitHub Issues for updates.
Let me know if you need further assistance!Mitch
01/27/2025, 9:06 PMMitch
01/27/2025, 9:06 PMpydantic.v1.error_wrappers.ValidationError: 1 validation error for Profile
settings
Unknown setting 'PREFECT_SERVER_ALLOW_EPHEMERAL_MODE'. (type=value_error)
Nate
01/27/2025, 9:15 PMpydantic.errors.PydanticUserError: If you usethis makes me think that somewhere in your code you are using awith pre=False (the default) you MUST specify@root_validator
. Note thatskip_on_failure=True
is deprecated and should be replaced with@root_validator
.@model_validator
root_validator
Nate
01/27/2025, 9:16 PMprefect
3.x uses pydantic 2.x exclusively at this point, so that shouldn't be coming from usMitch
01/27/2025, 9:18 PMMitch
01/27/2025, 9:19 PMMitch
01/27/2025, 9:41 PM