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

Add coerce_numbers_to_str option in str_schema #1249

Conversation

NeevCohen
Copy link
Contributor

Change Summary

Add coerce_numbers_to_str option in str_schema to support per-field configuration as requested in pydantic/pydantic#8383

Related issue number

pydantic/pydantic#8383

Checklist

  • [ x ] Unit tests for the changes exist
  • [ x ] 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 Mar 26, 2024

Codecov Report

Merging #1249 (6cc9989) into main (ab503cb) will decrease coverage by 0.55%.
Report is 50 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 6cc9989 differs from pull request most recent head 4a9cdf9. Consider uploading reports for the commit 4a9cdf9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1249      +/-   ##
==========================================
- Coverage   90.21%   89.67%   -0.55%     
==========================================
  Files         106      108       +2     
  Lines       16339    17061     +722     
  Branches       36       41       +5     
==========================================
+ Hits        14740    15299     +559     
- Misses       1592     1742     +150     
- Partials        7       20      +13     
Files Coverage Δ
python/pydantic_core/core_schema.py 94.66% <ø> (-0.10%) ⬇️
src/validators/string.rs 99.37% <100.00%> (+0.03%) ⬆️

... and 28 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 0830d0d...4a9cdf9. Read the comment docs.

Copy link

codspeed-hq bot commented Mar 26, 2024

CodSpeed Performance Report

Merging #1249 will not alter performance

Comparing NeevCohen:feature/coerce-numbers-to-str-in-str-schema (4a9cdf9) with main (0830d0d)

Summary

✅ 152 untouched benchmarks

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.

Amazing work! Now just needs the pydantic counterpart :)

@sydney-runkle sydney-runkle merged commit c607fd8 into pydantic:main Mar 26, 2024
28 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.

None yet

2 participants