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

Addextra parameter to the validate functions#1722

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

Open
anvilpete wants to merge1 commit intopydantic:main
base:main
Choose a base branch
Loading
fromanvilpete:extra-override

Conversation

anvilpete
Copy link

@anvilpeteanvilpete commentedMay 26, 2025
edited
Loading

Change Summary

This change adds anextra parameter to the validation functions, overriding any other model configuration. After a corresponding update to Pydantic, this will enable the following frompydantic/pydantic#9278:

SomeModel(BaseModel):my_field:intmodel_config=ConfigDict(extra="allow")data=SomeModel.model_validate(    {"myfield":1,"extra field":2},extra="forbid"# override model config and forbid extra fields just this time)

I've tried to add tests and update existing ones where it makes sense. It's a very small change but touches a wide surface area, so please let me know if I've missed anything.

See alsopydantic/pydantic#11057 for a similar request.

Related issue number

Checklist

  • Unit tests for the changes exist
  • (N/A) Documentation reflects the changes where applicable
  • Pydantic tests pass with thispydantic-core (except for expected changes)
  • My PR is ready to review,please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer:@sydney-runkle

azmeuk reacted with heart emoji
@anvilpete
Copy link
Author

please review

pydantic-hooky[bot] reacted with thumbs up emoji

@codecovCodecov
Copy link

codecovbot commentedMay 26, 2025
edited
Loading

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedMay 26, 2025
edited
Loading

CodSpeed Performance Report

Merging#1722 willnot alter performance

Comparinganvilpete:extra-override (559a3e0) withmain (22d34a7)

Summary

✅ 157 untouched benchmarks

@anvilpete
Copy link
Author

anvilpete commentedMay 26, 2025
edited
Loading

CI checks are failing with:

Warning: Failed to download action 'https://api.github.com/repos/dtolnay/rust-toolchain/tarball/4305c38b25d97ef35a8ad1f985ccf2d2242004f2'. Error: Response status code does not indicate success: 504 (Gateway Timeout). Warning: Back off 17.779 seconds before retry.Error: Response status code does not indicate success: 504 (Gateway Timeout).

Hopefully a temporary issue. But how do I re-run them? [Edit: a force-push or two later, everything seems ok now]

@anvilpeteanvilpeteforce-pushed theextra-override branch 3 times, most recently frombae98e8 to74c3cd9CompareMay 26, 2025 09:46
@anvilpete
Copy link
Author

@sydney-runkle anything I can do to help get this merged?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@anvilpete

[8]ページ先頭

©2009-2025 Movatter.jp