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

Switch to Pydantic v2 #592

Closed
tcompa opened this issue Oct 26, 2023 · 2 comments
Closed

Switch to Pydantic v2 #592

tcompa opened this issue Oct 26, 2023 · 2 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@tcompa
Copy link
Collaborator

tcompa commented Oct 26, 2023

This is an issue to track pydantic-related updates in fractal-tasks-core dependencies, and to discuss strategies for a future v1->v2 migration. Note that this can happen at multiple levels, e.g. we could migrate the dev tools first and the models later. TBD.

First update:

@tcompa tcompa added the dependencies Pull requests that update a dependency file label Oct 26, 2023
@tcompa tcompa changed the title Pydantic v2 support Switch to Pydantic v2 Jun 10, 2024
@tcompa
Copy link
Collaborator Author

tcompa commented Jun 10, 2024

This issue was explored in #737. Porting the code base to Pydantic V2 was mostly successful (and it mainly consists in updating validators), but we were not satisfied with the new use of anyOf for Optional arguments/attributes.

This is a common issue, and possible workarounds exist (e.g. #737 (comment), or the recent activity in pydantic/pydantic#7161).

We could give it a second try, by adopting one of those workarounds and checking how the outcome looks both in fractal-tasks-core and in other existing packages (ref #757), while keeping an eye on possibly more standard solutions in Pydantic.

@tcompa
Copy link
Collaborator Author

tcompa commented Aug 30, 2024

Closed with #793

@tcompa tcompa closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Development

No branches or pull requests

1 participant