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

Provide the available definitions when applying discriminated unions#11670

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
Viicos merged 1 commit intomainfromdiscriminator-defs
Apr 2, 2025

Conversation

Viicos
Copy link
Member

@ViicosViicos commentedApr 1, 2025
edited
Loading

It seems that we forgot to do so, and as almost all discriminated unions involves referenceable schemas (such as models, typed dicts, etc), the deferred metadata key was almost always set.

This fixes some issues in the schema cleaning process, although it is still theoretically unsound (see the added tests).

Fixes#11661.

Change Summary

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review,please add a comment including the phrase "please review" to assign reviewers

palle-k reacted with heart emoji
It seems that we forgot to do so, and as almost all discriminated unionsinvolves referenceable schemas (such as models, typed dicts, etc), thedeferred metadata key was almost always set.This fixes some issues in the schema cleaning process, although it isstill theoretically unsound (see the added tests).
@ViicosViicos added relnotes-fixUsed for bugfixes. third-party-testsAdd this label on a PR to trigger 3rd party tests backport-2.11Needs backport to 2.11 labelsApr 1, 2025
@ViicosViicos marked this pull request as ready for reviewApril 1, 2025 17:22
@cloudflare-workers-and-pagesCloudflare Workers and Pages

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit:3fe195a
Status: ✅  Deploy successful!
Preview URL:https://eaedca80.pydantic-docs.pages.dev
Branch Preview URL:https://discriminator-defs.pydantic-docs.pages.dev

View logs

@codspeed-hqCodSpeed HQ
Copy link

CodSpeed Performance Report

Merging#11670 willnot alter performance

Comparingdiscriminator-defs (3fe195a) withmain (6c38dc9)

Summary

✅ 46 untouched benchmarks

@github-actionsGitHub Actions
Copy link
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@ViicosViicos merged commit8b0825a intomainApr 2, 2025
88 checks passed
@ViicosViicos deleted the discriminator-defs branchApril 2, 2025 14:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@davidhewittdavidhewittdavidhewitt approved these changes

Assignees
No one assigned
Labels
backport-2.11Needs backport to 2.11relnotes-fixUsed for bugfixes.third-party-testsAdd this label on a PR to trigger 3rd party tests
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Model construction fails on non-union types annotated with discriminator.
2 participants
@Viicos@davidhewitt

[8]ページ先頭

©2009-2025 Movatter.jp