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

Pydantic 2.0 Migration #236

Closed
2 tasks
Kircheneer opened this issue Jul 3, 2023 · 4 comments · Fixed by #240
Closed
2 tasks

Pydantic 2.0 Migration #236

Kircheneer opened this issue Jul 3, 2023 · 4 comments · Fixed by #240
Milestone

Comments

@Kircheneer
Copy link
Collaborator

Kircheneer commented Jul 3, 2023

As part of the pydantic 2.0 release, a suite of breaking changes were released. We need to investigate where this breaks diffsync.

Issues already identified

  • extra="allow" is no longer possible
  • The __fields__ attribute is deprecated, furthermore it and its replacement model_fields no longer work with __init_subclass__ for us, because their fields are not populated until after this hook runs (see here for the accompanying discussion)

For more see here.

@Kircheneer
Copy link
Collaborator Author

@ghost
Copy link

ghost commented Aug 15, 2023

https://docs.pydantic.dev/latest/usage/model_config/#extra-attributes

extra=allow is still possible as I am using it, it's only not allowed in pydantic.dataclass

@Kircheneer Kircheneer added this to the 2.0.0 milestone Aug 18, 2023
@Kircheneer
Copy link
Collaborator Author

Due to a change where fields of type Optional now need explicit None defaults, this change can not be considered backwards-compatible.

@Kircheneer
Copy link
Collaborator Author

Closed with #240

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

Successfully merging a pull request may close this issue.

1 participant