pollination_dsl.dag.task module

pollination_dsl.dag.task.task(template, needs=None, loop=None, sub_folder: Optional[str] = None, sub_paths: Optional[Dict] = None, annotations: Optional[Dict] = None)

Task decorator for methods in a DAG.

@task(template=Template, …)

Parameters:
  • template – A pollination-dsl Function or DAG.

  • needs – A list of methods that this should be executed before this task. This task will only be executed after these tasks are executed successfully.

  • loop – An iterator to loop over. The task will be executed for each item in this iterator.

  • sub_folder – An optional sub_folder for execution of this task. If sub_folder is provided all the outputs from this task will be copied under the sub_folder. Sub_folder is usually used with loops and named based on the loop item to keep the results of each iteration in a separate folder.

  • sub_paths – A dictionary to provide sub_path for input arguments. Sub_path is useful when a task only needs a file or a sub folder from the provided argument.

  • annotations – An optional dictionary to annotate a task.