Skip to content

Flag on CLI airflow tasks test to attach debugger #15119

@GuillaumeDesforges

Description

@GuillaumeDesforges

Description

Any way to allow to attach a debugger when using airflow tasks test

Use case / motivation

Following discussion:

I generate DAGs dynamically using a database.
I want to debug tasks.

The doc (Debug Executor) suggests to add

if __name__ == '__main__':
  from airflow.utils.state import State
  dag.clear(dag_run_state=State.NONE)
  dag.run()

and run from IDE.

The above code snippet is something I'd rather avoid:

  • it is hard to select the right dag and tasks when they are generated automatically
  • it's a code artifact I'd rather avoid having, because everytime I test another dag, task or execution time, it creates git diffs

Are you willing to submit a PR?

No

Related Issues

Haven't seen any (?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions