Hi all, I am going in circles with resolving the m...
# ask-community
m
Hi all, I am going in circles with resolving the misconfiguration between prefect and pydantic. I have tried many versions, but currently failing with prefect 3.1.12 and pydantic 2.7.0 Using above config
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`.
Tried reverting back to pydantic 1.10.11 as that's what we has used in the past.
Copy code
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.
Copy code
pydantic.v1.error_wrappers.ValidationError: 1 validation error for Profile
settings
  Unknown setting 'PREFECT_SERVER_ALLOW_EPHEMERAL_MODE'. (type=value_error)
j
So, you'll need to decide whether you are targeting prefect 2 or prefect 3 -- it doesn't make sense to keep flop-flopping back and forth. Are you using pydantic in your own code or are all the pydantic models in prefect's code? Settings changes between prefect 2 and prefect 3 can probably be fixed by looking in your prefect profiles.toml file and editing it to be compatible with whichever version of prefect you are targeting. Or, it is possible that it's pulling a setting from your environment variables. Look at
prefect config
and
prefect profile
CLI commands to examine your settings.