Styxis
Company
Knowledge

Pydantic validate_call: making dropped TypedDict options visible to operators

Share the requested and accepted option sets, not just their values, so a dropped setting is not mistaken for a normal execution.

Pydantic validate_call: making dropped TypedDict options visible to operators

A function can finish without error while failing to apply a requested option. Silently removing an undeclared keyword can turn a typo into execution with a default, leaving the caller with a different outcome. Record requested, admitted, and defaulted settings to inspect this apparently successful mismatch. [1, 2, 3]

What the primary source establishes

A request describes undeclared keywords being removed from Unpack TypedDict arguments under validate_call, allowing a misspelled option to run with its default. The source also demonstrates existing rejection paths using extra=forbid or closed settings. [1]

The handover decision

Callers and operators should hand over requested, accepted, and defaulted options. Explicitly reject unknown options or approve a warning policy. Keep requested_key, accepted_key, and default_applied so successful execution is not treated as evidence that every requested setting took effect. [1, 3]

A reference defined before the output

The illustrative declared option is timeout. A request containing timeot should be rejected under the chosen policy so the caller can correct the intent. Rejected is normal for that request; accepted is the counterexample. This rule is an explicit policy choice, not proof that every ignore policy is defective. [1, 3]

The scoped Truthound check

Truthound Core 3.3.2 offers NotInSetValidator for forbidden typo or retired keys in a prepared request-key column. General unknown-key validation also needs a difference against the approved inventory. Rejecting a call or issuing a warning remains the API layer's responsibility. [1, 2, 3]

Limits and alternative choices

This is a proposal about defaults, not proof that every current ignore behavior is a confirmed defect. Specify TypedDict extra-forbid behavior explicitly and map supported legacy options separately. Changing an API documented to ignore unknown options into a rejecting API is a compatibility change. [1, 3]

Application conditions

Retain requested keys before validation and compare them with accepted and defaulted options under the approved policy.

Alternatives

Specify TypedDict extra-forbid behavior explicitly and map supported legacy options separately.

Limitations

  • This is a proposal about defaults, not proof that every current ignore behavior is a confirmed defect.

Evidence

Event checked
Subject checked
Modified