8000 fix function-after validator changing validation mode to Python by davidhewitt · Pull Request #967 · pydantic/pydantic-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

8000 fix function-after validator changing validation mode to Python #967

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

davidhewitt
Copy link
Contributor
@davidhewitt davidhewitt commented Sep 18, 2023

Change Summary

Corrects FunctionAfterValidator to handle the input generically over Python or JSON modes.

Related issue number

Fixes pydantic/pydantic#7468

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-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: @adriangb

@codecov
Copy link
codecov bot commented Sep 18, 2023

Codecov Report

Merging #967 (fec56a2) into main (e801531) will decrease coverage by 0.07%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #967      +/-   ##
==========================================
- Coverage   93.80%   93.74%   -0.07%     
==========================================
  Files         105      105              
  Lines       15468    15530      +62     
  Branches       25       25              
==========================================
+ Hits        14510    14558      +48     
- Misses        952      966      +14     
  Partials        6        6              
Files Changed Coverage Δ
src/validators/function.rs 93.80% <100.00%> (+1.23%) ⬆️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e801531...fec56a2. Read the comment docs.

@davidhewitt
Copy link
Contributor Author

please review

@codspeed-hq
Copy link
codspeed-hq bot commented Sep 18, 2023

CodSpeed Performance Report

Merging #967 will improve performances by 33.79%

Comparing dh/function-after-mode (fec56a2) with main (a17e9b6)

Summary

⚡ 3 improvements
✅ 135 untouched benchmarks

Benchmarks breakdown

Benchmark main dh/function-after-mode Change
test_small_class_core_dict 37 µs 32.6 µs +13.49%
test_chain_nested_functions 54.7 µs 43.5 µs +25.74%
test_chain_function 46.9 µs 35 µs +33.79%

Copy link
Member
@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

Not opposed to the code change (it's small, simple) but I think I may be missing the point

< 8000 div class="js-timeline-item js-timeline-progressive-focus-container" data-gid="HRFPE_lADOHHwfAM5xSIY_zwAAAAJsVKPP">
@davidhewitt davidhewitt force-pushed the dh/function-after-mode branch from 9db37cc to fec56a2 Compare September 19, 2023 08:31
@davidhewitt davidhewitt enabled auto-merge (squash) September 19, 2023 08:31
@davidhewitt davidhewitt merged commit fb7b501 into main Sep 19, 2023
@davidhewitt davidhewitt deleted the dh/function-after-mode branch September 19, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifying a model_validator(mode="after") on a BaseModel subclass breaks datetime.date serialization/validation in strict-mode
2 participants
0