Skip to content

Functions

Reusable Python function metadata without operator classifications.

function

function(*, returns: ReturnRole | None = None, args: dict[str, str] | None = None, category: str | None = None, validate_signature: bool = True) -> abc.Callable[[abc.Callable[_Parameters, _Result]], abc.Callable[_Parameters, _Result]]

Declare reusable contracts without wrapping the callable.

Parameters:

Name Type Description Default
returns ReturnRole | None

Independent return role; otherwise inferred from an unambiguous dataframe or None return annotation when the function is referenced.

None
args dict[str, str] | None

Explicit argument types, required when signature inspection is disabled.

None
category str | None

Optional descriptive grouping label, never an execution policy.

None
validate_signature bool

Whether authoring and compilation inspect the signature.

True

Returns:

Type Description
Callable[[Callable[_Parameters, _Result]], Callable[_Parameters, _Result]]

A decorator returning the original callable unchanged.

Raises:

Type Description
TypeError

Metadata has an invalid type.

ValueError

Contracts are missing or conflict with existing metadata.