-
-
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 dataclass_transform
decorator for pydantic dataclasses
#5120
Conversation
Not sure if this will conflict with #5009 which is a WIP implementation of dataclasses for V2 which I'm intending to complete this week? |
Just looked at it, as long as the public interface isn't changed (i.e. If you really want though, I could also change the target to |
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.
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
Line 3 in 6ab4207
As the import time is no longer a concern, I reverted the change. With that |
Closing in favor of #5111 |
Oh I realize this is for main, not 1.10.X, so I'll reopen it. |
* Fix mypy plugin for 1.1.0 (#5077) * Fix mypy plugin for 1.1.0 * Code review * Add version key to plugin data (cherry picked from commit 6267ae3) * Change file name * Add the changes from #5120 * Update changes file * Remove additional unneeded dataclass import (from #5120) --------- Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
I think it would make sense to move forward with this PR as well now that the changes have already been merged into |
Thanks @cdce8p! |
Remove
kw_only_default
and add additionalfield_specifier
for stdlib dataclass fields.This change should be backported to
1.10.X
since the next mypy release will break typing otherwise.Ref https://peps.python.org/pep-0681/#dataclass-transform-parameters
Fixes #5117