Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
MoveMapping
schema gen toGenerateSchema
to complete removal ofprepare_annotations_for_known_type
workaround#11247
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cloudflare-workers-and-pagesbot commentedJan 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 2b3bd7b |
Status: | ✅ Deploy successful! |
Preview URL: | https://5ba55455.pydantic-docs.pages.dev |
Branch Preview URL: | https://final-removal-of-prep-ann.pydantic-docs.pages.dev |
codspeed-hqbot commentedJan 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11247 willnot alter performanceComparing Summary
|
I feel like test_nested_model_serialization might be flaky, this PR should be unrelated... |
Mapping
schema gen toGenerateSchema
Mapping
schema gen toGenerateSchema
to complete removal ofprepare_annotations_for_known_type
workaroundgithub-actionsbot commentedJan 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
res = self._get_prepare_pydantic_annotations_for_known_type(obj, ()) | ||
if res is not None: | ||
source_type, annotations = res | ||
return self._apply_annotations(source_type, annotations) | ||
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.
Yay! This is what we've been trying to remove for a long time :)
# Assume Annotated[..., Field(...)] | ||
if _typing_extra.is_annotated(values_source_type): | ||
# Important that we use typing_extensions.get_args here in order to support 3.8 |
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.
# Important that we use typing_extensions.get_args here in order to support 3.8 |
Or in the PR droping 3.8, as you wish
aac7a53
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Following up on removing
_std_types_schema.py
and removing prepare annotations logic to increase consistency of annotation application patterns across the codebase.Specifically, the third and last in the series of#10846 and#11239.
Seeing marginal perf improvements in
GenerateSchema._prepare_annotations
, which is what we were hoping for:https://codspeed.io/pydantic/pydantic/branches/final-removal-of-prep-annI've attempted to keep the structure of the core schema gen + validators close to that of the original. I think this could be refactored, but I'd rather do that in a different PR, and have this just focus on movement of the logic.