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

Fix regex_engine being rejected by validate_core_schema #1011

Merged
merged 1 commit into from Oct 9, 2023

Conversation

davidhewitt
Copy link
Contributor

Change Summary

Makes it actually possible to set regex_engine in pydantic/pydantic#7768

Related issue number

Part of pydantic/pydantic#7714

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

@@ -106,6 +106,7 @@ class CoreConfig(TypedDict, total=False):
hide_input_in_errors: bool
validation_error_cause: bool # default: False
coerce_numbers_to_str: bool # default: False
regex_engine: Literal['rust-regex', 'python-re'] # default: 'rust-regex'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the interest of time today I have just pushed this missing item, I'd like to follow up with a proper test next week. 🙏

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #1011 (82e57a4) into main (8bbfb33) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1011   +/-   ##
=======================================
  Coverage   93.05%   93.05%           
=======================================
  Files         106      106           
  Lines       15713    15714    +1     
  Branches       35       35           
=======================================
+ Hits        14621    14622    +1     
  Misses       1085     1085           
  Partials        7        7           
Files Coverage Δ
python/pydantic_core/core_schema.py 94.75% <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 8bbfb33...82e57a4. Read the comment docs.

@davidhewitt davidhewitt enabled auto-merge (squash) October 9, 2023 14:17
@davidhewitt davidhewitt merged commit 8e66bd9 into main Oct 9, 2023
28 of 29 checks passed
@davidhewitt davidhewitt deleted the dh/core-schema-regex-engine branch October 9, 2023 14:19
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 9, 2023

CodSpeed Performance Report

Merging #1011 will improve performances by 14.19%

Comparing dh/core-schema-regex-engine (82e57a4) with main (8bbfb33)

Summary

⚡ 3 improvements
✅ 137 untouched benchmarks

Benchmarks breakdown

Benchmark main dh/core-schema-regex-engine Change
test_variable_tuple 38.5 µs 34.3 µs +12.46%
test_validate_literal[python-few_mixed] 33.1 µs 29 µs +14.19%
test_validate_literal[json-few_mixed] 35.3 µs 31.4 µs +12.53%

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.

None yet

2 participants