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

feat: add ser_json_bytes mode 'hex' #1016

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

PrettyWood
Copy link
Member

@PrettyWood PrettyWood commented Oct 14, 2023

Change Summary

Add 'hex' mode to ser_json_bytes to serialize bytes as the hexadecimal string representation

Related issue number

closes #937

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

Selected Reviewer: @dmontagu

@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Merging #1016 (aa7fde4) into main (f67e25c) will decrease coverage by 0.02%.
The diff coverage is 60.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1016      +/-   ##
==========================================
- Coverage   93.08%   93.06%   -0.02%     
==========================================
  Files         106      106              
  Lines       15739    15747       +8     
  Branches       35       35              
==========================================
+ Hits        14650    14655       +5     
- Misses       1082     1085       +3     
  Partials        7        7              
Files Coverage Δ
python/pydantic_core/core_schema.py 94.75% <100.00%> (ø)
src/serializers/config.rs 91.26% <55.55%> (-2.43%) ⬇️

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 f67e25c...aa7fde4. Read the comment docs.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 14, 2023

CodSpeed Performance Report

Merging #1016 will improve performances by 52.32%

Comparing PrettyWood:ser_json_bytes-hex (aa7fde4) with main (f67e25c)

Summary

⚡ 1 improvements
✅ 139 untouched benchmarks

Benchmarks breakdown

Benchmark main PrettyWood:ser_json_bytes-hex Change
test_decimal_from_string_core 82.2 µs 54 µs +52.32%

@PrettyWood
Copy link
Member Author

please review @davidhewitt

Copy link
Member

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

This looks pretty straightforward to me, thanks for making it happen!

@adriangb adriangb merged commit 005c8a7 into pydantic:main Oct 15, 2023
29 of 30 checks passed
@PrettyWood PrettyWood deleted the ser_json_bytes-hex branch October 15, 2023 15:06
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.

Add ser_json_bytes mode 'hex'
3 participants