@Marvin, how do I enable Pydantic 2 support in prefect 2?
m
Marvin
11/13/2023, 5:02 PM
In Prefect 2, Pydantic validation is enabled out-of-the-box. This is one of the new features introduced in Prefect 2, along with more flexibility for flow deployments, native async support, and others. You don't need to do anything special to enable Pydantic 2 support, it's already there in Prefect 2. For more details, you can check out the migration guide.
n
Nate
11/13/2023, 5:03 PM
while the suggested reasoning is wrong, it is true that pydantic 2 is "sort of" default
as in, if you pip install prefect without a pydantic pin, you will get pydantic 2, but internally we mostly grab v1 objects from their
pydantic.v1
compat module
j
Jack P
11/13/2023, 5:04 PM
oh sweet, there's no experimental setting I enable or anything 🦜
n
Nate
11/13/2023, 5:05 PM
nope! worst case scenario i think you find a rough edge between pydantic v2 and prefect and then pin