Jump to solution
Verify

The Fix

pip install pydantic==1.10.19

Based on closed pydantic/pydantic issue #9789 · 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.

Jump to Verify Open PR/Commit
@@ -372,21 +372,12 @@ jobs: test-typing-extensions: - name: test typing-extensions ${{ matrix.typing-extensions-version }} on Python ${{ matrix.python-version }} + name: test typing-extensions (`main` branch) on Python ${{ matrix.python-version }} runs-on: ubuntu-latest
repro.py
from pydantic import BaseModel, model_validator from typing import Optional class APIConfig(BaseModel): base_url: str = "pydantic.dev" api_url: Optional[str] = None @model_validator(mode='after') def set_api_url(self): if self.api_url is None: self.api_url = f"api.{self.base_url}" return self
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 the model's default values do not depend on other fields.\n\nOption C — Workaround\n```python\nWhen NOT to use: This fix should not be used if the model's default values do not depend on other fields.\n\n

Why This Fix Works in Production

  • Trigger: - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • Mechanism: The current implementation does not allow default values to depend on other field values
  • Why the fix works: Introduces support for default factories that can take validated data as an argument, allowing for more dynamic default value computation in Pydantic models. (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 current implementation does not allow default values to depend on other field values
  • Production symptom (often without a traceback): - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)

Proof / Evidence

Discussion

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

“@Viicos so in this case. Do you think we should support both _default_1 and _default_2 or just _default_1 will work after this feature added ?…”
@nix010 · 2024-10-05 · source
“Hi folks! Thanks for the detailed feature requests here”
@sydney-runkle · 2024-07-03 · source
“+1 For the context aware default factory or some variation of it.”
@adonath · 2024-08-06 · source
“@Viicos @aaazzam So I think this could be a bit interesting problem here”
@nix010 · 2024-10-04 · source

Failure Signature (Search String)

  • - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
  • - [X] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [X] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/) - [X] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)

Minimal Reproduction

repro.py
from pydantic import BaseModel, model_validator from typing import Optional class APIConfig(BaseModel): base_url: str = "pydantic.dev" api_url: Optional[str] = None @model_validator(mode='after') def set_api_url(self): if self.api_url is None: self.api_url = f"api.{self.base_url}" return self

What Broke

Users face limitations in setting dynamic default values based on other fields.

Why It Broke

The current implementation does not allow default values to depend on other field values

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 the model's default values do not depend on other fields.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option C — Workaround Temporary workaround

```python

When NOT to use: This fix should not be used if the model's default values do not depend on other fields.

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

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 the model's default values do not depend on other fields.

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.