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

Union Serialization #357

Merged
merged 27 commits into from
Jan 23, 2023
Merged

Union Serialization #357

merged 27 commits into from
Jan 23, 2023

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Jan 15, 2023

Continuation from #327, incorporating the ideas from the union discussion there.

@tiangolo @dmontagu @adriangb, I'd love your feedback.

Apart from some coverage and fixing the weird seg fault that's currently occurring in tests, I think this is ready to go.

Todo:

  • literal serialiser that warns on invalid value
  • warnings on TypedDict serialiser when required fields are omitted, and extra field are included - perhaps behind a check flag.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 15, 2023

CodSpeed Performance Report

Merging #357 union-serialization (58582d6) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 80 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2023

Codecov Report

Merging #357 (3f8a3cf) into main (8f42a9a) will decrease coverage by 1.44%.
The diff coverage is 79.86%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
- Coverage   96.50%   95.07%   -1.44%     
==========================================
  Files          87       90       +3     
  Lines        9455    10038     +583     
  Branches        4        4              
==========================================
+ Hits         9125     9544     +419     
- Misses        330      494     +164     
Impacted Files Coverage Δ
pydantic_core/__init__.py 100.00% <ø> (ø)
src/errors/mod.rs 92.30% <ø> (ø)
src/errors/value_exception.rs 94.56% <ø> (+2.67%) ⬆️
src/serializers/config.rs 92.94% <ø> (ø)
src/serializers/type_serializers/nullable.rs 74.46% <0.00%> (-22.76%) ⬇️
src/serializers/type_serializers/recursive.rs 84.78% <0.00%> (-12.72%) ⬇️
src/serializers/type_serializers/with_default.rs 77.77% <0.00%> (-19.45%) ⬇️
src/validators/custom_error.rs 100.00% <ø> (ø)
src/serializers/type_serializers/dict.rs 87.77% <41.17%> (-5.73%) ⬇️
src/serializers/type_serializers/url.rs 85.10% <45.45%> (-2.99%) ⬇️
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f42a9a...3f8a3cf. Read the comment docs.

@samuelcolvin samuelcolvin marked this pull request as ready for review January 17, 2023 00:35
@samuelcolvin samuelcolvin merged commit ed9747c into main Jan 23, 2023
@samuelcolvin samuelcolvin deleted the union-serialization branch January 23, 2023 13:08
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.

2 participants