Skip to content

Properly validate parameterized mappings#11658

Merged
Viicos merged 2 commits intomainfrom
mapping-regression
Apr 2, 2025
Merged

Properly validate parameterized mappings#11658
Viicos merged 2 commits intomainfrom
mapping-regression

Conversation

@Viicos
Copy link
Copy Markdown
Member

@Viicos Viicos commented Mar 31, 2025

Change Summary

Fixes #11650.

Regression in #11247, the logic was somehow tweaked when moved to the GenerateSchema class, so it was restored to how it was before.

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

@github-actions github-actions Bot added the relnotes-fix Used for bugfixes. label Mar 31, 2025
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 31, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a071a50
Status: ✅  Deploy successful!
Preview URL: https://36bb88bf.pydantic-docs.pages.dev
Branch Preview URL: https://mapping-regression.pydantic-docs.pages.dev

View logs

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 31, 2025

CodSpeed Performance Report

Merging #11658 will not alter performance

Comparing mapping-regression (a071a50) with main (dfa6c67)

Summary

✅ 46 untouched benchmarks

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2025

Coverage report

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

Copy link
Copy Markdown
Collaborator

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

LGTM with one comment

Comment thread tests/test_types.py Outdated
Comment on lines 6957 to 6958
Note - we still don't do a good job of handling subclasses, as we convert the input to a dict
via the MappingValidator annotation's schema.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this comment now out of date?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch -- well the MappingValidator is not a thing anymore but I think the comment is still relevant.

@Viicos Viicos enabled auto-merge (squash) April 2, 2025 20:36
@Viicos Viicos merged commit 34095c7 into main Apr 2, 2025
60 checks passed
@Viicos Viicos deleted the mapping-regression branch April 2, 2025 20:48
Viicos added a commit that referenced this pull request Apr 2, 2025
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.

Regression 2.10: Not properly validating disjunction of dataclasses (or TypedDict) that embed Mapping

2 participants