prism.task.PrismTask
Abstract class used to define tasks in a Prism project.
Constructor
prism.task.PrismTask
class prism.task.PrismTask(bool_run: bool = True, func: Optional[Callable[..., Any]] = None)
Parameters
bool_run: a boolean indicating whether to run the task. Default isTrue.func: optional callable that overwrites therunfunction. Default isNone.
Warning: you will never need to worry about instantiating a PrismTask class and setting bool_run / func when working with your tasks. This is all handled on the backend.
Methods
PrismTask.done(tasks: TaskManager, hooks: PrismHooks) -> bool
Check if this task is already done. If this task is already done, then the task will be skipped. If not, it will be executed.
Note that if the --full-refresh option is specified, then all tasks are run from scratch (even the ones that are done).
Parameters
tasks: Instance of the TaskManager class. This allows users to reference the output of other tasks within their task.hooks: Instance of the PrismHooks class. This allows users to access adapter connections using a low-level API.
Outputs:
Trueif the task is already done.Falseotherwise.
PrismTask.run(tasks: TaskManager, hooks: PrismHooks) -> Any
Core logic for your task. This task must return a non-null output.
Parameters
tasks: Instance of the TaskManager class. This allows users to reference the output of other tasks within their task.hooks: Instance of the PrismHooks class. This allows users to access adapter connections using a low-level API.
Outputs:
Any non-null output.
Attributes and underlying data
PrismTask.RETRY_DELAY_SECONDS
Number of seconds to wait in between task retries. Default is 0. Must be specified alongside RETRIES.
Last updated