Debug Executor

The DebugExecutor is meant as a debug tool and can be used from IDE. It is a single process executor that queues TaskInstance and executes them by running _run_raw_task method.

Due to its nature the executor can be used with SQLite database. When used with sensors the executor will change sensor mode to reschedule to avoid blocking the execution of DAG.

Additionally DebugExecutor can be used in a fail-fast mode that will make all other running or scheduled tasks fail immediately. To enable this option set AIRFLOW__DEBUG__FAIL_FAST=True or adjust fail_fast option in your airflow.cfg. For more information on setting the configuration, see Setting Configuration Options.

IDE setup steps:

  1. Add main block at the end of your DAG file to make it runnable.

It will run a backfill job:

if __name__ == "__main__":
    from airflow.utils.state import State

    dag.clear()
    dag.run()
  1. Setup AIRFLOW__CORE__EXECUTOR=DebugExecutor in run configuration of your IDE. In this step you should also setup all environment variables required by your DAG.

  2. Run / debug the DAG file.

Was this entry helpful?