-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: pydantic dataclass can inherit from stdlib dataclass and arbitrary_types_allowed
is supported
#2051
fix: pydantic dataclass can inherit from stdlib dataclass and arbitrary_types_allowed
is supported
#2051
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2051 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 4094 4096 +2
Branches 821 821
=========================================
+ Hits 4094 4096 +2
Continue to review full report at Codecov.
|
4a0dc9e
to
c58afee
Compare
arbitrary_types_allowed
is supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM.
@@ -57,6 +57,14 @@ them with `pydantic.dataclasses.dataclass`. | |||
``` | |||
_(This script is complete, it should run "as is")_ | |||
|
|||
Stdlib dataclasses (nested or not) can also be inherited and _pydantic_ will automatically validate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also add a comment about the arbitrary_types_allowed
logic change since that now behaves different from nested pydantic dataclasses or next pydantic models.
Just waiting on this (and #2046 which I can tweak) before releasing v1.7.1, if you're okay with that? |
Yes perfect! I'm adding documentation right now. I feel like #2055 should also be part of v1.7.1 since it fixes typing issues from #1663 |
Change Summary
#1817 introduced a regression when pydantic
dataclass
inherits from a stdlibdataclass
.This fixes the expected behaviour. Some extra documentation has also been added.
Related issue number
closes #2042
closes #2054
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)