Jump to solution
Verify

The Fix

pip install pydantic==2.11.0

Based on closed pydantic/pydantic issue #11390 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -17,7 +17,7 @@ from pydantic.errors import PydanticUserError -from . import _typing_extra +from . import _generics, _typing_extra from ._config import ConfigWrapper
repro.py
from pydantic import BaseModel from typing import Annotated from typing_extensions import deprecated class Model(BaseModel): a: Annotated[int, deprecated('test')] = 1 b: "Annotated[Test, deprecated('test')]" = 2 Test = int Model.model_rebuild() Model.model_fields['b'].deprecated == 'test' # False, should be True
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==2.11.0\nWhen NOT to use: This fix should not be used if the model relies on incomplete field evaluations.\n\n

Why This Fix Works in Production

  • Trigger: Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.
  • Mechanism: The model fields were inaccurate due to issues with evaluating forward annotations during model rebuilding
  • Why the fix works: Fixes bugs related to deprecated fields with forward annotations in Pydantic models, ensuring accurate field collection during model rebuilding. (first fixed release: 2.11.0).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • The model fields were inaccurate due to issues with evaluating forward annotations during model rebuilding
  • Production symptom (often without a traceback): Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.

Proof / Evidence

Discussion

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

“First bug: By fixing the first bug, second bug:”
Issue thread · issue description · source

Failure Signature (Search String)

  • Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.

Minimal Reproduction

repro.py
from pydantic import BaseModel from typing import Annotated from typing_extensions import deprecated class Model(BaseModel): a: Annotated[int, deprecated('test')] = 1 b: "Annotated[Test, deprecated('test')]" = 2 Test = int Model.model_rebuild() Model.model_fields['b'].deprecated == 'test' # False, should be True

What Broke

Model fields did not reflect deprecation warnings, leading to unexpected behavior in production.

Why It Broke

The model fields were inaccurate due to issues with evaluating forward annotations during model rebuilding

Fix Options (Details)

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

pip install pydantic==2.11.0

When NOT to use: This fix should not be used if the model relies on incomplete field evaluations.

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

First fixed release: 2.11.0

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 incomplete field evaluations.

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
2.11.0 Fixed

Related Issues

No related fixes found.

Sources

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