How to mark an Airflow DAG run as failed if any task fails?
问题 Is it possible to make an Airflow DAG fail if any task fails? I usually have some cleaning up tasks at the end of a DAG and as it is now, whenever the last task succeeds the whole DAG is marked as a success. 回答1: Another solution can be to add a final PythonOperator that checks the status of all tasks in this run: final_status = PythonOperator( task_id='final_status', provide_context=True, python_callable=final_status, trigger_rule=TriggerRule.ALL_DONE, # Ensures this task runs even if