Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support strict specification on union member types#11481

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

Merged
dmontagu merged 2 commits intomainfromfix-union-ser-strict
Feb 25, 2025

Conversation

sydney-runkle
Copy link
Contributor

Paired withpydantic/pydantic-core#1638

Addresses the bug reported in#10571

Inpydantic, we already don't allow users to apply thestrict annotation to union types. This PR ensures that thestrict specification on union members is respected (overrides config spec, if necessary).

@github-actionsgithub-actionsbot added the relnotes-fixUsed for bugfixes. labelFeb 24, 2025
@cloudflare-workers-and-pagesCloudflare Workers and Pages
Copy link

cloudflare-workers-and-pagesbot commentedFeb 24, 2025
edited
Loading

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit:620e0b6
Status: ✅  Deploy successful!
Preview URL:https://573a8393.pydantic-docs.pages.dev
Branch Preview URL:https://fix-union-ser-strict.pydantic-docs.pages.dev

View logs

Comment on lines +1723 to +1727
inner_schema = {**cls._inner_schema, 'strict': strict}
json_schema = core_schema.no_info_after_validator_function(
source, # construct the type
inner_schema, # pyright: ignore[reportArgumentType]
)
Copy link
ContributorAuthor

@sydney-runklesydney-runkleFeb 24, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is kind of gross, but so is this whole custom core schema construct for secret types

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedFeb 24, 2025
edited
Loading

CodSpeed Performance Report

Merging#11481 willnot alter performance

Comparingfix-union-ser-strict (620e0b6) withmain (d4fac86)

Summary

✅ 46 untouched benchmarks

@dmontagudmontagu merged commitc8acbec intomainFeb 25, 2025
23 of 51 checks passed
@dmontagudmontagu deleted the fix-union-ser-strict branchFebruary 25, 2025 22:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dmontagudmontagudmontagu approved these changes

Assignees
No one assigned
Labels
relnotes-fixUsed for bugfixes.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sydney-runkle@dmontagu

[8]ページ先頭

©2009-2025 Movatter.jp