Skip to content

fix: 8405 pattern serialization #1168

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
Jan 22, 2024
Merged

Conversation

Smixi
Copy link
Contributor

@Smixi Smixi commented Jan 20, 2024

Change Summary

Added Pattern type for serialization and default schema values.

Related issue number

fix pydantic/pydantic#8405

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable (I don't know if there is for other types).
  • 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

Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Merging #1168 (ce507bf) into main (4538190) will decrease coverage by 0.01%.
The diff coverage is 81.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1168      +/-   ##
==========================================
- Coverage   90.00%   89.99%   -0.01%     
==========================================
  Files         106      106              
  Lines       16656    16672      +16     
  Branches       36       36              
==========================================
+ Hits        14991    15004      +13     
- Misses       1658     1661       +3     
  Partials        7        7              
Files Coverage Δ
src/serializers/infer.rs 95.12% <90.00%> (-0.12%) ⬇️
src/serializers/ob_type.rs 81.46% <66.66%> (-0.36%) ⬇️

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 4538190...ce507bf. Read the comment docs.

Copy link

codspeed-hq bot commented Jan 20, 2024

CodSpeed Performance Report

Merging #1168 will improve performances by 27.51%

Comparing Smixi:add-pattern-type (ce507bf) with main (4538190)

Summary

⚡ 2 improvements
✅ 144 untouched benchmarks

Benchmarks breakdown

Benchmark main Smixi:add-pattern-type Change
test_core_future 37.7 µs 29.6 µs +27.51%
test_core_future_str 39.6 µs 31.6 µs +25.21%

@Smixi
Copy link
Contributor Author

Smixi commented Jan 20, 2024

please review

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.

This makes sense to me and is consistent with how similar implementations are done; let's merge 👍

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.

Regex's pattern is not serialized when creating a model's JSON schema
3 participants