The Fix
pip install pydantic==1.10.1
Based on closed pydantic/pydantic issue #9559 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -34,7 +34,7 @@ A few notes:
Type coercion like this can be extremely helpful but also confusing or not desired,
-see [below](#coercion-and-stictness) for a discussion of `validate_arguments`'s limitations in this regard.
+see [below](#coercion-and-strictness) for a discussion of `validate_arguments`'s limitations in this regard.
from enum import Enum
from decimal import Decimal
from pydantic import BaseModel
class EnumClass(Enum):
enum_value = 1
class ModelClass(BaseModel):
enum_field: EnumClass
validated_class = ModelClass.model_validate({"enum_field": Decimal(1)})
print(validated_class.enum_field)
# 2.4.2 - Prints "EnumClass.enum_value"
# 2.7.2 - Returns Validation Error:
# pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelClass
# enum_field
# Input should be 1 [type=enum, input_value=Decimal('1'), input_type=Decimal]
# For further information visit https://errors.pydantic.dev/2.7/v/enum
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==1.10.1\nWhen NOT to use: This fix should not be applied if the application relies on the previous validation behavior.\n\nOption B — Safe version pin\npip install pydantic==2.4.2\nWhen NOT to use: Do not use if you need features or security fixes in newer releases.\n\n
Why This Fix Works in Production
- Trigger: Validation of Enum Field with Decimal Fails
- Mechanism: Fixed a typo in the documentation regarding type coercion and strictness.
- Why the fix works: Fixed a typo in the documentation regarding type coercion and strictness. (first fixed release: 1.10.1).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.10 in real deployments (not just unit tests).
- Production symptom (often without a traceback): Validation of Enum Field with Decimal Fails
Proof / Evidence
- GitHub issue: #9559
- Fix PR: https://github.com/pydantic/pydantic-core/pull/1456
- First fixed release: 1.10.1
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.48
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Might even get a fix out in a patch release - will keep you updated. Likely an issue in pydantic-core.”
“I think it's not just related to Decimal, but any type which can compare equal with the enum members. For example, here's a custom class…”
“Hey @jroy-sophos, Thanks for your inquiry! I believe we'll be working on some enum validator fixes in v2.10 in September. I'll keep you updated on…”
“@jroy-sophos, Thanks for reporting this. Looks like probably an issue related to our enum validation changes in 2.7. I'll work on a fix for this…”
Failure Signature (Search String)
- Validation of Enum Field with Decimal Fails
- Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.
Copy-friendly signature
Failure Signature
-----------------
Validation of Enum Field with Decimal Fails
Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Validation of Enum Field with Decimal Fails
Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.
Minimal Reproduction
from enum import Enum
from decimal import Decimal
from pydantic import BaseModel
class EnumClass(Enum):
enum_value = 1
class ModelClass(BaseModel):
enum_field: EnumClass
validated_class = ModelClass.model_validate({"enum_field": Decimal(1)})
print(validated_class.enum_field)
# 2.4.2 - Prints "EnumClass.enum_value"
# 2.7.2 - Returns Validation Error:
# pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelClass
# enum_field
# Input should be 1 [type=enum, input_value=Decimal('1'), input_type=Decimal]
# For further information visit https://errors.pydantic.dev/2.7/v/enum
Environment
- Python: 3.10
- Pydantic: 2
What Broke
Validation errors occur when using Decimal with Enum fields, leading to application crashes.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.1
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option B — Safe version pin Backward-compatible pin
pip install pydantic==2.4.2
Use when you can’t upgrade immediately. Plan a follow-up to upgrade (pins can accumulate security/compat debt).
Fix reference: https://github.com/pydantic/pydantic-core/pull/1456
First fixed release: 1.10.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the application relies on the previous validation behavior.
- Do not use if you need features or security fixes in newer releases.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 2.4.2 | Working |
| 1.10.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.