Mohit Singhal
04/23/2024, 7:02 AMarbitrary_types_allowed
in Config")Marvin
04/23/2024, 7:02 AMarbitrary_types_allowed
configuration allows Pydantic models to work with arbitrary object types. Check if setting this to True
in the relevant Prefect configuration might solve your issue.
If those suggestions don't resolve the issue, it might be beneficial to review any recent changes in your flows or seek assistance through the Prefect community channels or support if you have a subscription.
If the issue persists and you believe it's a bug, consider opening a new issue on the Prefect GitHub repository with details about your flow and the error message.Mohit Singhal
04/23/2024, 7:04 AMMohit Singhal
04/23/2024, 7:04 AMMarvin
04/23/2024, 7:04 AMMohit Singhal
04/23/2024, 7:11 AMarbitrary_types_allowed
in Config")Marvin
04/23/2024, 7:12 AMarbitrary_types_allowed
in the Config class for Pydantic.
A similar issue can occur when using plain Python classes as type annotations. As stated in this Prefect Pull Request, Prefect modified the validation config to include arbitrary_types_allowed
, which instructs Pydantic to perform simple isinstance
checks instead of deep validation for non-Pydantic classes.
Given that your Pydantic version has been upgraded due to installing PyIceberg, you may need to adjust your code to be compatible with the Pydantic v2 syntax and validation requirements. Here are steps that could help resolve the issue:
1. Inspect the data types in your flow and identify which ones are custom or not part of the standard Pydantic validators.
2. If those types don't have custom validators and Pydantic raises errors, you’ll need to modify your Config classes to set arbitrary_types_allowed = True
. This change will allow Pydantic models to work with arbitrary object types.
3. In cases where you have defined specific types that require validation, you'll have to implement custom Pydantic validators for these types.
It's also noteworthy to check the Prefect documentation and GitHub issue tracker for any known issues or updates on version compatibility and to ensure that the Prefect version you're using is compatible with Pydantic v2.
The documentation links for handling custom validation could be helpful in creating custom validators if needed.
If the issue persists and you'd like a more detailed guide or specific examples, please specify which aspect you'd like assistance with, and I'll do my best to be helpful despite the dismal reality of software incompatibilities.