How to check failed task like task 1 is failed then run task 2, like if else condition.
I want to run the dependent task.
Task1 failed then how can i get that error log in a condition like if task1== failed then run task2 and else task3. I tried SSHHOOK
but I am looking for a simple solution.
with DAG(
'airflow',
catchup=False,
default_args={
'owner': 'abc',
'start_date': datetime(2018, 4, 17),
'schedule_interval':None,
'depends_on_past': False,
},
) as dag:
task_1 = PythonOperator(
task_id='task_1',
python_callable=do(),
)
task_2 = PythonOperator(
task_id='task_2',
python_callable=do(),
)
task_3 = PythonOperator(
task_id='task_3',
python_callable=do()
task_3.set_upstream(task_2)
task_2.set_upstream(task_1)