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: fix use of computed_field setter with field_dependencies #336

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

tlambert03
Copy link
Member

fixes #334

@tlambert03 tlambert03 changed the title fix: fix use of computed_field setter with property_setters fix: fix use of computed_field setter with field_dependencies Nov 8, 2024
Copy link

codspeed-hq bot commented Nov 8, 2024

CodSpeed Performance Report

Merging #336 will not alter performance

Comparing tlambert03:fix-computed-field (adfd566) with main (37bd312)

Summary

✅ 67 untouched benchmarks

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (37bd312) to head (adfd566).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #336   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         2076      2084    +8     
=========================================
+ Hits          2076      2084    +8     

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

@sjdemartini
Copy link
Contributor

Awesome, thank you for adding this! Looks great from the tests!

@sjdemartini
Copy link
Contributor

Minor note: while you're here, looks like the error message is missing a space here

"Fields with dependencies must be fields or property.setters."
f"{prop!r} is not."

after property.setters., which makes the error message appear like:

ValueError: Fields with dependencies must be fields or property.setters.'c' is not.

@tlambert03 tlambert03 merged commit 97c2fc1 into pyapp-kit:main Nov 8, 2024
56 checks passed
@tlambert03 tlambert03 deleted the fix-computed-field branch November 8, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Adding Pydantic v2 @computed_field decorator prevents class creation with dependencies
2 participants