prefect-soda-core
prefect-soda-core copied to clipboard
Cannot pickle 'classmethod' object
Hello,
I'm getting this error with the latest prefect version (=2.13) while it works with the previous version.
The error happens when we try to import the prefect-soda-core class during the deployment of the flow:
prefect.exceptions.ScriptError: Script at 'src/my_soda_flow.py' encountered an exception: TypeError("cannot pickle 'classmethod' object")
I'll investigate on my side and let you know what I find.
Hey @PaoloLeonard 👋
Thanks for reporting the issue.
Currently, there aren't any classmethods in prefect-soda-core.
However, there might be classmethods in the soda-core package that's being used under the hood.
Let me know what you find!
I believe the issue comes from the upgrade to pydantic v2: https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md#enabling-pydantic-v2 where support for @root_validator was dropped: https://docs.pydantic.dev/latest/migration/
I will test further to confirm my suspicion
I'm having the same issue! Have you been able to fix this? @PaoloLeonard
@PaoloLeonard @digitalghost-dev few weeks ago we pinned pydantic<2.
Can you try with prefect-soda-core==0.1.8?
Thanks!
Looks like that worked. Thank you. Does this mean prefect-soda-core will be updated to use pydantic>2 at some point? @AlessandroLollo
@digitalghost-dev I think so, but we'll need to figure out how to fix it first 😅
@AlessandroLollo Fair enough haha thanks for your help.