-
Notifications
You must be signed in to change notification settings - Fork 292
Add ability to specify dataclass name in dataclass_schema #603
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
'ctx': {'dataclass_name': 'FooDataclass[dataclass_args_schema]'}, | ||
'input': 123, | ||
'loc': ('foo', 'FooDataclass[cls_name]'), | ||
'msg': 'Input should be a dictionary or an instance of FooDataclass[dataclass_args_schema]', |
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.
Note the value in ctx
and msg
comes from the dataclass_args_schema
, whereas the value in loc
comes from the dataclass_schema
.
CodSpeed Performance ReportMerging #603 Summary
Benchmarks breakdown
|
Actually, I guess this may be unnecessary if we take the parametrizations-are-subclasses approach for dataclasses the way we do for BaseModel. I was hoping to avoid that but maybe that's the right way to do it. |
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
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #603 +/- ##
==========================================
+ Coverage 94.11% 94.13% +0.02%
==========================================
Files 98 98
Lines 13177 13188 +11
Branches 25 25
==========================================
+ Hits 12401 12414 +13
+ Misses 770 768 -2
Partials 6 6
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This change would be necessary to get the type parameters into the generated loc values when working with generic dataclasses.
I think regardless of what we do with generic dataclasses this is probably a change worth making as:
Even though generic dataclasses isn't ready yet on the pydantic side, I'll open this now as I think it will be necessary no matter what we do there.