Transform
Use @transform on a function before adding it to a pipeline. The decorated
function also validates its inputs and output when called directly.
Use @side_effect or @transform(side_effect=True) for a final step that writes or prints data.
It must declare -> None. Pass include_side_effects=False to Pipeline.run()
to skip these steps while running the rest of the pipeline.
data_joinery.transform.transform
Decorate a function to validate its annotated inputs and output.
Use as @transform, @transform(), or
@transform(side_effect=True). A side-effect transform must explicitly
return None and can be skipped by Pipeline.run. DataFrame contracts in
Annotated control schema validation and coercion. Other supported
runtime classes are checked with isinstance.
| PARAMETER | DESCRIPTION |
|---|---|
f
|
Function to decorate. Omit when using
TYPE:
|
side_effect
|
Mark a terminal transform that can be skipped by a pipeline run.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Transform[P, R] | Callable[[Callable[P, R]], Transform[P, R]]
|
A callable transform that can also be added to a pipeline. |
Source code in src/data_joinery/transform.py
data_joinery.transform.side_effect
Mark a terminal transform as a side effect.
This is shorthand for @transform(side_effect=True). The function must
explicitly declare -> None. Calling it directly still runs it.