python
data_error
ai_generated
true
pydantic.errors.NumberError: value is not less than or equal to 100
ID: python/pydantic-constraint-violation
80%Fix Rate
86%Confidence
0Evidence
2024-02-28First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2.x | active | — | — | — |
Root Cause
A numeric field with Field(le=100) receives a value greater than 100, violating the constraint.
generic中文
带有 Field(le=100) 的数字字段接收到大于 100 的值,违反了约束。
Workarounds
-
90% success
Adjust input value to meet constraint: value = min(value, 100)
-
95% success
Modify Field constraint: Field(le=200)
Dead Ends
Common approaches that don't work:
-
50% fail
lt means strictly less than, so 100 would still fail.
-
70% fail
Type mismatch with constraints may cause issues.