Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -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,
repro.py
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'] = ()`. """
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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).
Production impact:
  • 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

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
affected (exit=None)
fixed (exit=0)

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…”
@adriangb · 2024-09-15 · source
“The proposal looks good ! Thank you for tackling this!! If I rephrase the changes: - a/ if the namespace is protected, remove the annoying…”
@antoine-lizee · 2024-09-11 · source
“A few thoughts here: * I think setting a field name to match any of our existing methods should raise an Exception, rather than relying…”
@samuelcolvin · 2024-09-13 · source
“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…”
@eyurtsev · 2024-09-13 · source

Failure Signature (Search String)

  • from pydantic import BaseModel

Error Message

Stack trace
error.txt
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

repro.py
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

When NOT to use: This fix should not be used if strict namespace protection is required for model attributes.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be used if strict namespace protection is required for model attributes.

Verify Fix

verify
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

VersionStatus
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.