prism.task.PrismTask

Abstract class used to define tasks in a Prism project.

Constructor

chevron-rightprism.task.PrismTaskhashtag

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 is True.

    • func: optional callable that overwrites the run function. Default is None.

circle-exclamation

Methods

chevron-rightPrismTask.done() -> boolhashtag

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).

  • Outputs:

    • True if the task is already done. False otherwise.

chevron-rightPrismTask.run() -> Anyhashtag

Core logic for your task. This task must return a non-null output.

  • Outputs:

    • Any non-null output.

Attributes and underlying data

chevron-rightPrismTask.task_idhashtag

The ID to associate with the task. The default is <module_name>.<class name>.

chevron-rightPrismTask.retrieshashtag

Number of times to retry a task upon failure. Default is 0.

chevron-rightPrismTask.retry_delay_secondshashtag

Number of seconds to wait in between task retries. Default is 0. Must be specified alongside retries.

Last updated