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: Support extracting generic bound from TypeVar #88

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

antonagestam
Copy link
Owner

@antonagestam antonagestam commented Dec 16, 2023

Adds support for Pydantic models that are generic with a currency type.

Fixes #87.

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9e0ff83) to head (76ec9cf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #88   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines         2512      2515    +3     
  Branches       439       441    +2     
=========================================
+ Hits          2512      2515    +3     

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

@zvsdev
Copy link

zvsdev commented Aug 15, 2024

@antonagestam I've been trying this branch out locally on a project so far it's working great. What kinds of tests did you want to add for it?

@antonagestam
Copy link
Owner Author

@antonagestam I've been trying this branch out locally on a project so far it's working great. What kinds of tests did you want to add for it?

Hey there, I'm happy to hear this is working out for you. This was a long time ago, but it looks like the new conditionals need to be covered, and the TypeError case might have also changed.

@antonagestam
Copy link
Owner Author

@zvsdev as long as there's some unit test covering the three exit possibilities of this function, I'd be happy. In case you're willing to work on this, please feel entirely free to modify and push this work as your own in a new PR!

@antonagestam antonagestam force-pushed the feature/schema-generic-bound-from-typevar branch 4 times, most recently from f90186e to 165760d Compare August 18, 2024 11:29
@antonagestam antonagestam marked this pull request as ready for review August 18, 2024 11:32
Adds support for Pydantic models that are generic with a currency type
parameter.
@antonagestam antonagestam force-pushed the feature/schema-generic-bound-from-typevar branch from 165760d to 76ec9cf Compare August 18, 2024 11:32
@antonagestam antonagestam merged commit 041fcf9 into main Aug 18, 2024
7 checks passed
@antonagestam antonagestam deleted the feature/schema-generic-bound-from-typevar branch August 18, 2024 11:34
@antonagestam
Copy link
Owner Author

@zvsdev I just merged this, thanks for the friendly nudge! It's released now in version 0.10.0.

@zvsdev
Copy link

zvsdev commented Aug 18, 2024

@antonagestam aha awesome speed! BTW amazing work on this package, won't be long before pydantic takes over the fintech world.

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.

Support Pydantic schemas with generic currency
3 participants