-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
incorrect exception raised when nested model validation fails #449
Comments
polyfactory
fails because can not handle Annotated.__metadata__
when it is in a model used in a fieldpolyfactory
fails because can not handle Annotated.__metadata__
when it is in a model used in a field of another model
@olk-m thanks for reporting this. The |
polyfactory
fails because can not handle Annotated.__metadata__
when it is in a model used in a field of another model
The reason this was failing is because This now poses a question on how to handle the cases where
Personally, I'm leaning towards the first option. It's more explicit whereas the second option is implicit. |
Thank you for a quick response.
I agree that if a user uses a bare |
Description
Problem 1
Can not handle
Predicate
in a model that is used in a field of a primary model.Problem 2
Misleading, wrong error.
The error says
polyfactory.exceptions.ParameterException: received constraints for unsupported type list[__main__.Pet]
but the real error is much deeper, in a specific field:MCVE
Logs
Expected behavior
Ignore
Annotated.__metadata__
in a model that is used in a field and continue execution.Release Version
Version: 2.12.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: