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: msgspec discriminated unions #2081

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

indrat
Copy link
Contributor

@indrat indrat commented Sep 1, 2024

adds support for:

  • adding base class kwargs to the msgpsec template in order to support adding tag and tag_field kwargs for Struct.
  • the discriminator property, uses the propertyName as the tag_field and the literal value as the tag.

this may not be the ideal method for doing this so happy for any feedback to improve it.

aiming to address #1610

indrat and others added 2 commits September 1, 2024 21:18
adds support for:
- adding base class kwargs to the msgpsec template in order to support
  adding tag and tag_field kwargs for Struct.
- the discriminator property, uses the propertyName as the tag_field
  and the literal value as the tag.
Copy link

codspeed-hq bot commented Sep 1, 2024

CodSpeed Performance Report

Merging #2081 will not alter performance

Comparing indrat:discriminated-unions-msgspec-support (e6c97b4) with main (d0c0f16)

Summary

✅ 30 untouched benchmarks

⁉️ 1 dropped benchmarks

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

Benchmarks breakdown

Benchmark main indrat:discriminated-unions-msgspec-support Change
⁉️ test_main_use_generic_container_types_standard_collections 245.1 ms N/A N/A

Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d0c0f16) to head (e6c97b4).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2081   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4250      4260   +10     
  Branches       984       986    +2     
=========================================
+ Hits          4250      4260   +10     
Flag Coverage Δ
unittests 99.67% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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