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

Fix: do not check for__get_validators__ on classes where__get_pydantic_core_schema__ is also defined#11444

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
sydney-runkle merged 3 commits intopydantic:mainfromtlambert03:fix-gen-schema
Feb 17, 2025

Conversation

tlambert03
Copy link
Contributor

@tlambert03tlambert03 commentedFeb 14, 2025
edited
Loading

Related issue number

fixes#11443 by not checking for the existence of__get_validators__ on classes where__get_pydantic_core_schema__ is also defined. See also#10863, which introduced the change

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

Selected Reviewer:@sydney-runkle

@github-actionsgithub-actionsbot added the relnotes-fixUsed for bugfixes. labelFeb 14, 2025
@tlambert03tlambert03 changed the titlefix: Fix conditional check for validators in schema generationfix: do not check for__get_validators__ on classes where__get_pydantic_core_schema__ is also definedFeb 14, 2025
@github-actionsGitHub Actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic/_internal
  _generate_schema.py
Project Total 

This report was generated bypython-coverage-comment-action

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedFeb 14, 2025
edited
Loading

CodSpeed Performance Report

Merging#11444 willnot alter performance

Comparingtlambert03:fix-gen-schema (e5f0a81) withmain (2f3e1ac)

Summary

✅ 46 untouched benchmarks

@tlambert03
Copy link
ContributorAuthor

please review ... thanks!

pydantic-hooky[bot] reacted with thumbs up emoji

Copy link
Contributor

@sydney-runklesydney-runkle left a comment

Choose a reason for hiding this comment

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

Wonderful, thanks@tlambert03!

We always appreciate your contributions. The clean unit test is great!

@sydney-runkle
Copy link
Contributor

Exciting to see that this was caught by folks testing alpha releases. This really helps on our end.

tlambert03 reacted with thumbs up emoji

@sydney-runklesydney-runkle merged commitc2102b7 intopydantic:mainFeb 17, 2025
53 checks passed
@sydney-runklesydney-runkle changed the titlefix: do not check for__get_validators__ on classes where__get_pydantic_core_schema__ is also definedFix: do not check for__get_validators__ on classes where__get_pydantic_core_schema__ is also definedFeb 17, 2025
@tlambert03
Copy link
ContributorAuthor

thanks@sydney-runkle :)

@tlambert03tlambert03 deleted the fix-gen-schema branchFebruary 17, 2025 15:57
@Viicos
Copy link
Member

@tlambert03@sydney-runkle I was in the process of answering in the linked issue. This might have to be reverted/changed.

tlambert03 reacted with thumbs up emoji

@tlambert03
Copy link
ContributorAuthor

no worries. just let us know what you learn, feel free to revert or change as needed

@Viicos
Copy link
Member

Side note: this only works because a deprecated__get_pydantic_core_schema__() method is defined onBaseModel. This fix will no longer work when this method will be removed fromBaseModel in v3, but the support for__get_validators__() will also be removed at this point.

@tlambert03
Copy link
ContributorAuthor

ah, gotcha. Thanks for the clarification

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sydney-runklesydney-runklesydney-runkle approved these changes

Assignees

@sydney-runklesydney-runkle

Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Broken validation of fields in `pydantic==2.11.0a{1,2}
3 participants
@tlambert03@sydney-runkle@Viicos

[8]ページ先頭

©2009-2025 Movatter.jp