-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Computed_fields outputs a property object instead of the value #7458
Comments
Hi, Thanks for your question. We recently addressed this issue in this PR, and these changes should get released with the next version. The changes make it such that an error is raised when a We decided to raise an error here because this behavior is both prohibited by dataclasses and discouraged by If you're looking for a workaround, using a model validator with Let me know if you have any more questions! 😄 |
Ok... |
Sure thing - we've been discussing this decision in #7250. |
Closing in favor of continuing discussion on #7250. |
Initial Checks
Description
Hello,
When a model inherits from another model, overriding one of its fields with a
computed_field
, the overridden computed field returns a property object instead of the value produced by the function.I am running pydantic==2.3.0 (pydantic_core==2.6.3)
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: