yera.typing.validate
Validation: checking that an app's annotations are drawn from the supported set.
Symbols
is_allowed_type
is_allowed_type(
type_hint: type | None,
) → boolCheck whether a type hint is supported for validation and serialization.
Parameters
type_hint
type: type | None
A Python type (e.g., int, list[str], MyEnum, pd.DataFrame).
Returns
type: bool
True if the type is in the allowed set; False otherwise.
validate_signature
validate_signature(
fn: Callable,
type_hints: dict[str, type],
identifier: str | None = None,
) → NoneValidate a function's parameters and return type against supported types.
Parameters
fn
type: Callable
The function to inspect.
type_hints
type: dict[str, type]
The resolved type hints (as from typing.get_type_hints()).
identifier
type: str | None = None
Optional human-readable name for error messages.
Raises
TypeError
If unsupported parameter kinds are found, or if required parameters lack type hints, or if any type hint is not supported.