Skip to content

References

Import-independent resource lookups for Python declarations.

FunctionReference dataclass

A function location normalized without importing or executing its module.

module instance-attribute

module: str

name instance-attribute

name: str

returns class-attribute instance-attribute

returns: ReturnRole | None = None

args class-attribute instance-attribute

args: dict[str, str] | None = None

validate_signature class-attribute instance-attribute

validate_signature: bool = True

description class-attribute instance-attribute

description: str | None = None

category class-attribute instance-attribute

category: str | None = None

signature class-attribute instance-attribute

signature: Signature | None = dataclasses.field(default=None, repr=False, compare=False)

entrypoint property

entrypoint: str

Return the entrypoint in module.path:qualname format.

InputReference dataclass

Bases: Reference

A feature ID by default, or explicit feature metadata.

name property

name: Reference

Select the display name.

unit property

unit: Reference

Select the measurement unit.

description property

description: Reference

Select the description.

type property

type: Reference

Select the logical feature type.

OutputReference dataclass

Bases: Reference

A feature returned by an operator.

name property

name: Reference

Select the display name.

unit property

unit: Reference

Select the measurement unit.

description property

description: Reference

Select the description.

type property

type: Reference

Select the logical feature type.

to_model

to_model() -> str

Return the portable feature selector.

ProfileGrainReference dataclass

Grain selectors available on a profile reference.

value instance-attribute

value: str

ids property

ids: Reference

Select dataframe key names in grain order.

Reference dataclass

A portable selector and its binding value kind.

kind instance-attribute

kind: str

value instance-attribute

value: str

role class-attribute instance-attribute

role: Literal['input', 'output'] | None = None

id property

id: Reference

Select a resource identifier.

to_model

to_model() -> str

Return the document selector.

function

function(function: Callable[..., object] | str, *, returns: ReturnRole | None = None, args: dict[str, str] | None = None, category: str | None = None, validate_signature: bool | None = None, description: str | None = None) -> FunctionReference

Reference a callable or a module.path:qualname entrypoint string.

Parameters:

Name Type Description Default
function Callable[..., object] | str

A named Python callable such as module.calculate, or an importable module and qualified name separated by a colon. Creating a reference does not load code; compilation and execution do.

required
returns ReturnRole | None

Explicit independent return role when annotations are ambiguous.

None
args dict[str, str] | None

Explicit reusable argument types.

None
category str | None

Optional free-form grouping label stored in the Spec.

None
validate_signature bool | None

Whether compilation and documentation should inspect the Python signature and validate implementation contracts.

None
description str | None

Optional explicit function description. Defaults to the docstring summary line when a callable is given.

None

Returns:

Type Description
FunctionReference

A reference containing the module location, function name, and

FunctionReference

description.

Raises:

Type Description
TypeError

If the argument is neither callable nor a string, category is not a string, or validate_signature is not a boolean.

ValueError

If the entrypoint is invalid or the callable has no valid module and function name, or if contracts conflict or are missing.

input

input(name: str) -> references.InputReference

Reference an input feature by ID, defaulting to its column identifier.

output

output(name: str) -> references.OutputReference

Reference a feature returned by an operator.

key

key(column_id: str) -> references.Reference

Reference a dataframe key column by its resolution column ID.

dimension

dimension(name: str) -> references.DimensionReference

Reference a dimension by ID.

profile

profile(name: str | None = None) -> references.ProfileReference

Reference a named profile, or the current profile when omitted.

dataset

dataset(name: str | None = None) -> references.Reference

Select a named profile's runtime dataset, or the current profile's dataset.

fragment

fragment() -> references.Reference

Select the current operator's computed fragment dataframe.

row_context

row_context(attribute: Literal['before', 'after', 'dimension']) -> references.Reference

Select a scalar attribute of the current operator's row context.

params

params(name: str) -> references.Params

Reference a required configuration value without reading configuration.

paths

paths(name: str) -> references.Paths

Reference a configured project path without resolving it during authoring.