Skip to content

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

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

@codspeed-hq
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 👍

@davidhewitt davidhewitt merged commit 8be45e6 into pydantic:main Jan 22, 2024
davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 22, 2025
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