<@ULVA73B9P> I've been having issue with prefect.f...
# ask-marvin
q
@Marvin I've been having issue with prefect.flow_run and it always crashed with an error of
Copy code
Crash detected! Execution was interrupted by an unexpected exception: AttributeError: module 'pydantic' has no attribute 'Secret'
The UI suggested it might be the version compatibility issue of pydantic package. How can I know which version is compatible
m
The error you're encountering seems to be related to a compatibility issue with Pydantic versions. Prefect 3.x is built with Pydantic 2.0, which introduces changes that might affect your code if you are using custom Pydantic models. The error
AttributeError: module 'pydantic' has no attribute 'Secret'
suggests that your code might be relying on features from Pydantic 1.x, which are not present in Pydantic 2.x. Here are a few steps you can take: 1. Upgrade to Pydantic 2.x: Ensure your project is using Pydantic 2.x. Prefect 3.0 is compatible with Pydantic 2.x, as mentioned in the Prefect upgrade notes. 2. Check for Migration: If you're using custom Pydantic models, refer to Pydantic’s migration guide to make the necessary changes for compatibility with Pydantic 2.x. 3. Secret Handling: The
SecretStr
type is now used to obfuscate values in Prefect. This might require updates in your code if you previously used
pydantic.Secret
. For more detailed information, you can refer to the relevant Prefect documentation. If you have more specific needs or further issues, feel free to ask.