The Fix
pip install pydantic==1.10.19
Based on closed pydantic/pydantic issue #10315 · 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%.
@@ -273,7 +273,7 @@ def push(self, config_wrapper: ConfigWrapper | ConfigDict | None):
validate_default=False,
validate_return=False,
- protected_namespaces=('model_',),
+ protected_namespaces=('model_validate', 'model_dump'),
hide_input_in_errors=False,
from pydantic import BaseModel
class Model(BaseModel):
model_id: str
"""
UserWarning: Field "model_id" in Model has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
"""
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.19\nWhen NOT to use: This fix should not be used if strict namespace protection is required for model attributes.\n\n
Why This Fix Works in Production
- Trigger: from pydantic import BaseModel
- Mechanism: The default `protected_namespaces` setting caused frequent warnings for fields prefixed with `model_`
- Why the fix works: Relaxed the default `protected_namespaces` config setting to remove warnings for fields prefixed with `model_`. (first fixed release: 1.10.19).
- 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
- The default `protected_namespaces` setting caused frequent warnings for fields prefixed with `model_`
- Surfaces as: from pydantic import BaseModel
Proof / Evidence
- GitHub issue: #10315
- Fix PR: https://github.com/pydantic/pydantic/pull/10441
- First fixed release: 1.10.19
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.62
Verified Execution
We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.
- Status: PASS
- Ran: 2026-02-11T16:52:29Z
- Package: pydantic
- Fixed: 1.10.19
- Mode: fixed_only
- Outcome: ok
Logs
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Not sure how much we are thinking about short term vs long term but I think we've discussed in the past: - using pydantic_ as…”
“The proposal looks good ! Thank you for tackling this!! If I rephrase the changes: - a/ if the namespace is protected, remove the annoying…”
“A few thoughts here: * I think setting a field name to match any of our existing methods should raise an Exception, rather than relying…”
“Keeping model_validate_ and model_dump_ in the protected namespaces should be fine -- they're long enough that collisions will be rare. The most common patterns we've…”
Failure Signature (Search String)
- from pydantic import BaseModel
Error Message
Stack trace
Error Message
-------------
from pydantic import BaseModel
class Model(BaseModel):
model_dump: dict
"""
NameError: Field "model_dump" conflicts with member <function BaseModel.model_dump at 0x10360c5e0> of protected namespace "model_".
"""
Minimal Reproduction
from pydantic import BaseModel
class Model(BaseModel):
model_id: str
"""
UserWarning: Field "model_id" in Model has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
"""
What Broke
Users experienced warnings and errors when using common field names in AI/ML contexts.
Why It Broke
The default `protected_namespaces` setting caused frequent warnings for fields prefixed with `model_`
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.19
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/pydantic/pull/10441
First fixed release: 1.10.19
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if strict namespace protection is required for model attributes.
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 |
|---|---|
| 1.10.19 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.