LaktoryContext
laktory.models.LaktoryContext
ยค
Bases: BaseModel
Runtime context object optionally injected into user-supplied functions by Laktory.
Passed as the laktory_context keyword argument when the called function's
signature explicitly declares it. Contains references to the
pipeline objects active at call time.
To opt in, add laktory_context=None to your function signature:
from laktory.models import LaktoryContext
def my_write(df, laktory_context: LaktoryContext = None) -> None:
print(laktory_context.sink)
print(laktory_context.node)
return df
| PARAMETER | DESCRIPTION |
|---|---|
node
|
Parent PipelineNode, or None when called outside a pipeline.
TYPE:
|
pipeline
|
Parent Pipeline, or None when called outside a pipeline.
TYPE:
|
sink
|
Current data sink.
TYPE:
|
source
|
Current data source.
TYPE:
|