Airflow - How to get list of upstream failed tasks?

Viewed 34

Consider a DAG where tasks A, B, and C have a downstream task all_success, that waits for all of upstream to be successful.

a = run_this = BashOperator(task_id='run_after_loop', bash_command='exit 1',)
b = run_this = BashOperator(task_id='run_after_loop', bash_command='exit 0',)
c = run_this = BashOperator(task_id='run_after_loop', bash_command='exit 1',)

all_success = DummyOperator(task_id='all_success', trigger_rule='all_success',)
a >> all_success
b >> all_success
c >> all_success

What I can replace all_success with, that will show (stdout in code) the list of all upstream tasks that failed for this particular DAG run?

Edit: I know I can see it in UI, but I'm looking to get the list in a stdout. My use case is that I have some huge DAGs with hundreds of initial tasks. If any of them fail, it's very hard to scroll through the UI to find what all failed.

0 Answers
Related