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
Agreed, I think a duplicate of pydantic/pydantic#8570, which has a proposed fix by erroring in pydantic/speedate#55 but that got stuck after I suggested instead fixing the underflow. I see you also agree with my assessment that fixing the underflow is the right solution 😂
Hi Pydantic team, thanks for the great library!!
I'm reporting a bug that looks to me like an underflow issue when validating datetimes are greater than a given datetime.
Here's a reproducible example. I'm using Pydantic v2.6.4. Which is the latest at the time of writing.
The reason I think it's an underflow issue is that if I change my model to
Then I get a validation error for
1500-01-01T00:00:00Z
that it should be less than2030-01-01T00:00:00Z
.I reproduced the same thing by constructing the schema directly.
I can work around this by using an
AfterValidator
and performing the Ge/Lt validation in python-land.Cheers.
The text was updated successfully, but these errors were encountered: