You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/31 20:33:49 UTC

[GitHub] [airflow] GuillaumeDesforges opened a new issue #15119: Flag on CLI airflow tasks test to attach debugger

GuillaumeDesforges opened a new issue #15119:
URL: https://github.com/apache/airflow/issues/15119


   **Description**
   
   Any way to allow to attach a debugger when using `airflow tasks test`
   
   **Use case / motivation**
   
   Following [discussion](https://github.com/apache/airflow/discussions/14621):
   
   I generate DAGs dynamically using a database.
   I want to debug tasks.
   
   The doc ([Debug Executor](https://airflow.apache.org/docs/apache-airflow/stable/executor/debug.html)) suggests to add
   
   ```python
   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 (?)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #15119: Flag on CLI airflow tasks test to attach debugger

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #15119:
URL: https://github.com/apache/airflow/issues/15119#issuecomment-811448411


   Are you aware of the the `dag.cli()` function? That might help you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] GuillaumeDesforges commented on issue #15119: Flag on CLI airflow tasks test to attach debugger

Posted by GitBox <gi...@apache.org>.
GuillaumeDesforges commented on issue #15119:
URL: https://github.com/apache/airflow/issues/15119#issuecomment-815853085


   You seem to be referring to [this](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/index.html#airflow.models.DAG.cli)?
   
   In order to use this command, I need to hard-write in my code which DAG to use, when my script generates a lot of them. I do not want to write which dag should be tested to the git history, when it changes frequently.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org