Skip to content
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

pass extra argument in arguments validator #1094

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

andresliszt
Copy link
Contributor

This PR tries to solve this pydantic issue. It gets from config the key extra_fields_behavior and performs the validations with respect to the value. For now i applied it only in the kw arguments, if you think this is fine i could add it to the positional arguments as well

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

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Merging #1094 (0e1dedd) into main (c7daf16) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1094   +/-   ##
=======================================
  Coverage   89.70%   89.70%           
=======================================
  Files         106      106           
  Lines       16359    16360    +1     
  Branches       35       35           
=======================================
+ Hits        14675    14676    +1     
  Misses       1677     1677           
  Partials        7        7           
Files Coverage Δ
src/validators/arguments.rs 99.58% <100.00%> (+<0.01%) ⬆️

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 c7daf16...0e1dedd. Read the comment docs.

Copy link

codspeed-hq bot commented Nov 27, 2023

CodSpeed Performance Report

Merging #1094 will degrade performances by 18.28%

Comparing andresliszt:add/extra-arguments-validator (0e1dedd) with main (c7daf16)

Summary

❌ 2 regressions
✅ 138 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main andresliszt:add/extra-arguments-validator Change
test_core_str 31 µs 37.9 µs -18.25%
test_core_future_str 31.3 µs 38.3 µs -18.28%

Copy link
Contributor

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

Thanks, this looks good to me 👍

@davidhewitt davidhewitt merged commit 7fa450d into pydantic:main Nov 30, 2023
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants