-
Notifications
You must be signed in to change notification settings - Fork 290
Set info.data and info.field_name for dataclass field validators #454
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
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #454 +/- ##
=======================================
Coverage 95.36% 95.37%
=======================================
Files 93 93
Lines 11115 11124 +9
Branches 22 22
=======================================
+ Hits 10600 10609 +9
Misses 510 510
Partials 5 5
Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #454 Summary
|
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.
LGTM
let extra = Extra { | ||
field_name: Some(&field.name), | ||
..extra | ||
}; |
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.
This seems necessary, but do we have any benchmarks that would pick up on performance impact of this? Not sure it matters.
Looks good to me with the only possible concern being the creation of more I think if there's any interest in eliminating the copying of |
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.
Okay I looked it up, considering Extra
is just four optional references and a bool I think performance impact should be pretty negligible.
It's also what we already do elsewhere: pydantic-core/src/validators/typed_dict.rs Lines 189 to 193 in 653308f
|
No description provided.