Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pickle 'classmethod' object #28

Open
PaoloLeonard opened this issue Oct 20, 2023 · 7 comments
Open

Cannot pickle 'classmethod' object #28

PaoloLeonard opened this issue Oct 20, 2023 · 7 comments

Comments

@PaoloLeonard
Copy link

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.

@AlessandroLollo
Copy link
Collaborator

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!

@PaoloLeonard
Copy link
Author

PaoloLeonard commented Oct 23, 2023

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

@digitalghost-dev
Copy link

digitalghost-dev commented Jan 4, 2024

I'm having the same issue! Have you been able to fix this? @PaoloLeonard

@AlessandroLollo
Copy link
Collaborator

@PaoloLeonard @digitalghost-dev few weeks ago we pinned pydantic<2.
Can you try with prefect-soda-core==0.1.8?

Thanks!

@digitalghost-dev
Copy link

digitalghost-dev commented Jan 4, 2024

Looks like that worked. Thank you. Does this mean prefect-soda-core will be updated to use pydantic>2 at some point? @AlessandroLollo

@AlessandroLollo
Copy link
Collaborator

@digitalghost-dev I think so, but we'll need to figure out how to fix it first 😅

@digitalghost-dev
Copy link

@AlessandroLollo Fair enough haha thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants