Qiong Liu
01/30/2025, 8:01 PMCrash 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 compatibleMarvin
01/30/2025, 8:01 PMAttributeError: 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.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by