Dispatcher
laktory.dispatcher.Dispatcher
¤
Dispatcher(stack=None, env=None)
The dispatcher is a manager that can be used to run and monitor remote jobs
and DLT pipelines defined in a stack. It is generally used through Laktory
CLI run
command, but may be used directly in scripts and python
programs.
PARAMETER | DESCRIPTION |
---|---|
stack
|
Stack object
TYPE:
|
env
|
Selected environment
TYPE:
|
Examples:
```py tag:skip-run from laktory import Dispatcher from laktory import models
with open("./stack.yaml") as fp: stack = models.Stack.model_validate_yaml(fp)
dispatcher = Dispatcher(stack=stack) dispatcher.get_resource_ids() pl = dispatcher.resources["pl-stock-prices"] job = dispatcher.resources["job-stock-prices"]
Run pipeline¤
pl.run(current_run_action="WAIT", full_refresh=False)
Run job¤
job.run(current_run_action="CANCEL") ```
METHOD | DESCRIPTION |
---|---|
init_resources |
Set resource for each of the resources defined in the stack |
get_resource_ids |
Get resource ids for each of the resources defined in the stack in the |
run_job |
Run job with name |
run_dlt |
Run DLT pipeline with name |
ATTRIBUTE | DESCRIPTION |
---|---|
env |
Selected environment
TYPE:
|
wc |
Databricks Workspace Client
TYPE:
|
Source code in laktory/dispatcher/dispatcher.py
51 52 53 54 55 56 57 |
|
Attributes¤
Functions¤
init_resources
¤
init_resources()
Set resource for each of the resources defined in the stack
Source code in laktory/dispatcher/dispatcher.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
get_resource_ids
¤
get_resource_ids(env=None)
Get resource ids for each of the resources defined in the stack in the
provided environment env
.
Source code in laktory/dispatcher/dispatcher.py
170 171 172 173 174 175 176 177 178 179 |
|
run_job
¤
run_job(job_name, *args, **kwargs)
Run job with name job_name
PARAMETER | DESCRIPTION |
---|---|
job_name
|
Name of the job
TYPE:
|
*args
|
Arguments passed to
DEFAULT:
|
**kwargs
|
Keyword arguments passed to
DEFAULT:
|
Source code in laktory/dispatcher/dispatcher.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
run_dlt
¤
run_dlt(dlt_name, *args, **kwargs)
Run DLT pipeline with name dlt_name
PARAMETER | DESCRIPTION |
---|---|
dlt_name
|
Name of the DLT pipeline
TYPE:
|
*args
|
Arguments passed to
DEFAULT:
|
**kwargs
|
Keyword arguments passed to
DEFAULT:
|
Source code in laktory/dispatcher/dispatcher.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|