The Fix
pip install pydantic==1.10.17
Based on closed pydantic/pydantic issue #9187 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -1783,11 +1783,11 @@ the type annotation for `__pydantic_extra__`:
from typing import Dict
-from pydantic import BaseModel, ConfigDict, ValidationError
+from pydantic import BaseModel, ConfigDict, Field, ValidationError
from pydantic import BaseModel, ConfigDict
class Model(BaseModel):
__pydantic_extra__: dict[str, int]
a: int
model_config = ConfigDict(extra="allow")
m = Model(a=1) # Argument missing for parameter "__pydantic_extra__" Pylance (reportCallIssue)
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.17\nWhen NOT to use: This fix should not be used if the model requires __pydantic_extra__ to be a mandatory argument.\n\nOption C — Workaround\nis to define your model as:\nWhen NOT to use: This fix should not be used if the model requires __pydantic_extra__ to be a mandatory argument.\n\n
Why This Fix Works in Production
- Trigger: Pyright/Pylance typing error when overriding `__pydantic_extra__` type
- Mechanism: The type annotation for __pydantic_extra__ was not properly handled in the model's __init__ method
- Why the fix works: Allows a field specifier on __pydantic_extra__, addressing the typing error when overriding this type. (first fixed release: 1.10.17).
- 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 type annotation for __pydantic_extra__ was not properly handled in the model's __init__ method
- Production symptom (often without a traceback): Pyright/Pylance typing error when overriding `__pydantic_extra__` type
Proof / Evidence
- GitHub issue: #9187
- Fix PR: https://github.com/pydantic/pydantic/pull/9659
- First fixed release: 1.10.17
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.62
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“When https://github.com/pydantic/pydantic/pull/9659 gets merged, I think the solution to this will be to do: (or similar, with whatever type hint you want on the pydantic…”
“Looks good as a workaround, so the docs can probably be updated with the added PrivateAttr. #9293 already applied the change on the BaseModel.__pydantic_extra__ annotation…”
“@zEdS15B3GCwq, Thanks for reporting this! Yep, looks like a bug. Great first issue, for anyone interested!”
“@Viicos, What do you think about this approach here (we might need some docs changes): Thinking about this approach on the heels of https://github.com/pydantic/pydantic/pull/9293”
Failure Signature (Search String)
- Pyright/Pylance typing error when overriding `__pydantic_extra__` type
- Similar to #9147 and #7094, but those seem to be focused on `TypeAdapter` and I'm unsure how closely those are related. Sorry if this is a duplicate.
Copy-friendly signature
Failure Signature
-----------------
Pyright/Pylance typing error when overriding `__pydantic_extra__` type
Similar to #9147 and #7094, but those seem to be focused on `TypeAdapter` and I'm unsure how closely those are related. Sorry if this is a duplicate.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Pyright/Pylance typing error when overriding `__pydantic_extra__` type
Similar to #9147 and #7094, but those seem to be focused on `TypeAdapter` and I'm unsure how closely those are related. Sorry if this is a duplicate.
Minimal Reproduction
from pydantic import BaseModel, ConfigDict
class Model(BaseModel):
__pydantic_extra__: dict[str, int]
a: int
model_config = ConfigDict(extra="allow")
m = Model(a=1) # Argument missing for parameter "__pydantic_extra__" Pylance (reportCallIssue)
Environment
- Pydantic: 2
What Broke
Type checkers report missing argument errors when instantiating models with __pydantic_extra__.
Why It Broke
The type annotation for __pydantic_extra__ was not properly handled in the model's __init__ method
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.17
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
is to define your model as:
Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.
Fix reference: https://github.com/pydantic/pydantic/pull/9659
First fixed release: 1.10.17
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the model requires __pydantic_extra__ to be a mandatory argument.
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.17 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.