You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have attempted to make this bug report once from another account: #506
But it is not visible to any other users (or when logged out)
I am attempting to use nested annotations with pydantic FieldInfo on each level.
I have seen #434
and for a moment i thought simply updating polyfactory would solve my problem, but alas.
From what i can see these nested annotations are working correctly in pydantic and seems to be the expectation for more complex annotations, such that FieldInfo is applied to the correct "level" of the annotation.
The a and b attributes produce two different errors that seem related.
pydantic_core._pydantic_core.ValidationError: 3 validation errors for MyModel
a.0
Input should be less than or equal to 5 [type=less_than_equal, input_value=67018326269.9516, input_type=float]
For further information visit https://errors.pydantic.dev/2.6/v/less_than_equal
a.3
Input should be less than or equal to 5 [type=less_than_equal, input_value=4563270605912.7, input_type=float]
For further information visit https://errors.pydantic.dev/2.6/v/less_than_equal
b.0
Input should be less than or equal to 5 [type=less_than_equal, input_value=60.518708028656015, input_type=float]
For further information visit https://errors.pydantic.dev/2.6/v/less_than_equal
This is a known bug (#493). #499 has a fix for this and if I run your MCVE on that branch, there are no validation errors. For now, you'll have to downgrade to 2.14.0 since the bug was introduced in 2.14.1.
I agree that the MCVE is solved by downgrading to 2.14.0.
But i am still getting similar errors in my production code.
I am trying to make a new MCVE showing these in 2.14.0.
I agree that the MCVE is solved by downgrading to 2.14.0. But i am still getting similar errors in my production code. I am trying to make a new MCVE showing these in 2.14.0.
@XenoMonk the fix has been released as part of 2.15.0. It'd be great if you could test it out with that and see if you're still facing any issues.
Description
I have attempted to make this bug report once from another account: #506
But it is not visible to any other users (or when logged out)
I am attempting to use nested annotations with pydantic FieldInfo on each level.
I have seen #434
and for a moment i thought simply updating polyfactory would solve my problem, but alas.
From what i can see these nested annotations are working correctly in pydantic and seems to be the expectation for more complex annotations, such that FieldInfo is applied to the correct "level" of the annotation.
The a and b attributes produce two different errors that seem related.
URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
No response
Logs
Release Version
Python: 3.10
Pydantic: 2.6.1
Polyfactory: 2.14.1
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: