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 json-or-python serializer as JSON object key #903

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

davidhewitt
Copy link
Contributor

Change Summary

Change json-or-python serializer to delegate to the json serializer to decide what to do as a JSON key.

Related issue number

Fixes pydantic/pydantic#6795

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

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #903 (843a8b4) into main (a4015ab) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #903      +/-   ##
==========================================
+ Coverage   93.74%   93.78%   +0.03%     
==========================================
  Files         105      105              
  Lines       15331    15331              
  Branches       25       25              
==========================================
+ Hits        14372    14378       +6     
+ Misses        953      947       -6     
  Partials        6        6              
Files Changed Coverage Δ
src/serializers/type_serializers/json_or_python.rs 97.95% <100.00%> (+12.24%) ⬆️

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 a4015ab...843a8b4. Read the comment docs.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 21, 2023

CodSpeed Performance Report

Merging #903 will degrade performances by 13.9%

Comparing dh/json-or-python-key-ser (843a8b4) with main (a4015ab)

Summary

❌ 1 regressions
✅ 137 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main dh/json-or-python-key-ser Change
test_model_exclude_unset_false 63.7 µs 74 µs -13.9%

@davidhewitt davidhewitt merged commit 8bf9e5f into main Aug 21, 2023
29 of 30 checks passed
@davidhewitt davidhewitt deleted the dh/json-or-python-key-ser branch August 21, 2023 16:35
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.

model_dump_json issuing UserWarning for dict[Enum, Any] field
2 participants