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

Merged
merged 6 commits into from
Nov 10, 2024

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 (c56c569) with main (6c3e114)

Summary

✅ 30 untouched benchmarks

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 (6c3e114) to head (c56c569).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2081   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4263      4273   +10     
  Branches       984       986    +2     
=========================================
+ Hits          4263      4273   +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.

@koxudaxi koxudaxi merged commit da7d054 into koxudaxi:main Nov 10, 2024
76 checks passed
@indrat indrat deleted the discriminated-unions-msgspec-support branch November 11, 2024 10:30
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