Jump to solution
Verify

The Fix

pip install pydantic==1.10.18

Based on closed pydantic/pydantic issue #9909 · 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
@@ -1481,6 +1481,8 @@ def _union_is_subclass_schema(self, union_type: Any) -> core_schema.CoreSchema: """Generate schema for a Type, e.g. `Type[int]`.""" type_param = self._get_first_arg_or_any(type_) + # Assume `type[Annotated[<typ>, ...]]` is equivalent to `type[<typ>]`: + type_param = _typing_extra.annotated_type(type_param) or type_param if type_param == Any:
repro.py
from typing import Annotated, Type from pydantic import BaseModel class Model(BaseModel): a: Type[int] class Model(BaseModel): a: Type[Annotated[int, ...]]
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.18\nWhen NOT to use: This fix should not be used if the model relies on the original behavior of type annotations.\n\n

Why This Fix Works in Production

  • Trigger: TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'
  • Mechanism: The code attempted to use an annotated type in a way that caused a TypeError
  • Why the fix works: Allows the usage of `type[Annotated[...]]` in Pydantic models, addressing a TypeError when using annotated types. (first fixed release: 1.10.18).
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

  • Shows up under Python 3.11 in real deployments (not just unit tests).
  • The code attempted to use an annotated type in a way that caused a TypeError
  • Surfaces as: TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'

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.18
  • Mode: fixed_only
  • Outcome: ok
Logs
affected (exit=None)
fixed (exit=0)

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Thanks for fixing so quickly @Viicos 🧘🏼‍♂️”
@crsren · 2024-07-22 · source
“@crsren, Thanks for reporting this. Indeed, I think this deserves its own issue :).”
@sydney-runkle · 2024-07-17 · source
“I don't know if the form type[Annotated[int, ...]] makes sense: from a typing theory perspective, annotated metadata is ignored and does not have any effect”
@Viicos · 2024-07-18 · source
“I agree that type[Annotated[int,...]] itself wouldn't makes sense! Only gave that as the simplest possible example to reproduce the error”
@crsren · 2024-07-18 · source

Failure Signature (Search String)

  • TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'

Error Message

Stack trace
error.txt
Error Message ------------- TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'

Minimal Reproduction

repro.py
from typing import Annotated, Type from pydantic import BaseModel class Model(BaseModel): a: Type[int] class Model(BaseModel): a: Type[Annotated[int, ...]]

Environment

  • Python: 3.11

What Broke

Users experienced TypeErrors when using annotated types in Pydantic models.

Why It Broke

The code attempted to use an annotated type in a way that caused a TypeError

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==1.10.18

When NOT to use: This fix should not be used if the model relies on the original behavior of type annotations.

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/9932

First fixed release: 1.10.18

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 the model relies on the original behavior of type annotations.

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.18 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.