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

Do not delete mock validator/serializer inmodel_rebuild()#11890

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 intomainfromrebuild-mock
May 21, 2025

Conversation

Viicos
Copy link
Member

@ViicosViicos commentedMay 20, 2025
edited
Loading

pydantic-core won't use them anyway as it checks for__pydantic_complete__ first. This is done in order to avoid concurrency issues, where a concurrent model instantiation would use the validator from a parent class if themodel_rebuild() call did not finish in another thread.

Change Summary

Fixes#11849, regression in#11429, alternative to#11851.

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

`pydantic-core` won't use them anyway as it checks for `__pydantic_complete__`first. This is done in order to avoid concurrency issues, where a concurrentmodel instantiation would use the validator from a parent class if the`model_rebuild()` call haven't finished in another thread.
@github-actionsgithub-actionsbot added the relnotes-fixUsed for bugfixes. labelMay 20, 2025
@cloudflare-workers-and-pagesCloudflare Workers and Pages

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit:42175f7
Status: ✅  Deploy successful!
Preview URL:https://9bc7b193.pydantic-docs.pages.dev
Branch Preview URL:https://rebuild-mock.pydantic-docs.pages.dev

View logs

@codspeed-hqCodSpeed HQ
Copy link

CodSpeed Performance Report

Merging#11890 willnot alter performance

Comparingrebuild-mock (42175f7) withmain (53f460c)

Summary

✅ 46 untouched benchmarks

@github-actionsGitHub Actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

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

This report was generated bypython-coverage-comment-action

@davidhewitt
Copy link
Contributor

Does this mean that multiple threads might start rebuilding at the same time? Such a race seems not ideal.

@Viicos
Copy link
MemberAuthor

Yes, but this was already the case before 2.11. It isn't ideal as it can result in multiple unnecessary rebuilds, but seems like this is somewhat safe as we got no reports about this before.

davidhewitt reacted with thumbs up emoji

@ViicosViicos merged commit0a21ab1 intomainMay 21, 2025
59 checks passed
@ViicosViicos deleted the rebuild-mock branchMay 21, 2025 08:11
@ViicosViicos mentioned this pull requestMay 21, 2025
5 tasks
Viicos added a commit that referenced this pull requestMay 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hramezanihramezanihramezani 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.

(race condition?) Subclass skipped in model instantiation
3 participants
@Viicos@davidhewitt@hramezani

[8]ページ先頭

©2009-2025 Movatter.jp