Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run one airflow task and all its dependencies?

I suspected that

airflow run dag_id task_id execution_date

would run all upstream tasks, but it does not. It will simply fail when it sees that not all dependent tasks are run. How can I run a specific task and all its dependencies? I am guessing this is not possible because of an airflow design decision, but is there a way to get around this?

like image 454
itzjustricky Avatar asked Mar 06 '17 19:03

itzjustricky


People also ask

How do I run a single task in Airflow?

You can run a task independently by using -i/-I/-A flags along with the run command. But yes the design of airflow does not permit running a specific task and all its dependencies.

How do I create a dynamic task in Airflow?

Airflow's dynamic task mapping feature is built off of the MapReduce programming model. The map procedure takes a set of inputs and creates a single task for each one. The reduce procedure, which is optional, allows a task to operate on the collected output of a mapped task.

What are the precedence rules for the tasks in Airflow?

The precedence rules for a task are as follows: Explicitly passed arguments. Values that exist in the default_args dictionary. The operator's default value, if one exists.


1 Answers

You can run a task independently by using -i/-I/-A flags along with the run command.

But yes the design of airflow does not permit running a specific task and all its dependencies.

You can backfill the dag by removing non-related tasks from the DAG for testing purpose

like image 158
Priyank Mehta Avatar answered Sep 28 '22 03:09

Priyank Mehta