Pydantic 2.0 Migration
Kircheneer opened this issue · 4 comments
Kircheneer commented
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 replacementmodel_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.
Deleted user commented
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 commented
Due to a change where fields of type Optional
now need explicit None
defaults, this change can not be considered backwards-compatible.
Kircheneer commented
Closed with #240