-
Notifications
You must be signed in to change notification settings - Fork 117
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
BUG: Default Values in Model Are Incorrectly Set as 'ExpressionProxy' Objects #669
Comments
interesting, it appears to have something to do with the inheretence of the model, will have to look into it. |
We are having this issue as well. It's going to prevent us from upgrading to pydantic 2.0 |
For some odd reason in child classes it looks like some context WRT the defaults is being lost, I opened a PR to fix it (it just applies the defaults). |
Hi @slorello89, can you please tell us when the PR will be merged? It's preventing us to integrate redis in our project. |
Seems like #612 is related to this. Looking for a fix soon. |
When defining default values in a JsonModel, these values are unexpectedly being set as ExpressionProxy objects instead of the intended default values.
Expected Behavior:
Default values defined in the model should be directly set as the specified values.
Actual Behavior:
Default values are replaced with ExpressionProxy objects.
Steps to reproduce:
When running the following code:
produces the following output:
Additional Notes:
However, replacing JsonModel by pydantic BaseModel works fine
This code produces the following output:
Environment
redis-om
version: 0.3.3pydantic
version: 2.9.2The text was updated successfully, but these errors were encountered: