Skip to content

Allow callable discriminator to be applied on PEP 695 type aliases#11941

Merged
Viicos merged 2 commits intomainfrom
type-alias-tag
Jun 14, 2025
Merged

Allow callable discriminator to be applied on PEP 695 type aliases#11941
Viicos merged 2 commits intomainfrom
type-alias-tag

Conversation

@Viicos
Copy link
Copy Markdown
Member

@Viicos Viicos commented Jun 2, 2025

Change Summary

Fixes #11930.

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

@Viicos Viicos added the relnotes-fix Used for bugfixes. label Jun 2, 2025
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f54ea1
Status:⚡️  Build in progress...

View logs

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 2, 2025

CodSpeed Performance Report

Merging #11941 will create unknown performance changes

Comparing type-alias-tag (7f54ea1) with main (fb6117a)

Summary

🆕 46 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 test_getattr N/A 54.6 µs N/A
🆕 test_setattr N/A 89.7 µs N/A
🆕 test_efficiency_with_highly_nested_examples N/A 730.3 µs N/A
🆕 test_schema_build N/A 2.7 ms N/A
🆕 test_fastapi_startup_perf N/A 83 ms N/A
🆕 test_fastapi_startup_perf N/A 19.8 ms N/A
🆕 test_import_basemodel N/A 26 µs N/A
🆕 test_import_field N/A 25.9 µs N/A
🆕 test_isinstance_basemodel N/A 26.9 ms N/A
🆕 test_complex_model_schema_generation N/A 1.5 ms N/A
🆕 test_construct_dataclass_schema N/A 1.1 ms N/A
🆕 test_failed_rebuild N/A 218.5 µs N/A
🆕 test_lots_of_models_with_lots_of_fields N/A 2 s N/A
🆕 test_model_validators_serializers N/A 763.6 µs N/A
🆕 test_nested_model_schema_generation N/A 825.7 µs N/A
🆕 test_recursive_model_schema_generation N/A 839.4 µs N/A
🆕 test_simple_model_schema_generation N/A 606.3 µs N/A
🆕 test_simple_model_schema_lots_of_fields_generation N/A 22.3 ms N/A
🆕 test_tagged_union_with_callable_discriminator_schema_generation N/A 1 ms N/A
🆕 test_tagged_union_with_str_discriminator_schema_generation N/A 1 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  types.py
Project Total  

This report was generated by python-coverage-comment-action

Comment thread pydantic/types.py Outdated
@Viicos Viicos requested a review from DouweM June 13, 2025 08:50
@Viicos Viicos merged commit ddb1a68 into main Jun 14, 2025
56 of 57 checks passed
@Viicos Viicos deleted the type-alias-tag branch June 14, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes-fix Used for bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag not extracted from Annotated when using nested named type aliases.

2 participants