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 2022/09/30 13:51:56 UTC

[GitHub] [airflow] ashb opened a new issue, #26802: pdb no longer works with airflow test command since 2.3.3

ashb opened a new issue, #26802:
URL: https://github.com/apache/airflow/issues/26802

   Converted back to issue as I've reproduced it and traced the issue back to https://github.com/apache/airflow/pull/24362
   
   ### Discussed in https://github.com/apache/airflow/discussions/26352
   
   <div type='discussions-op-text'>
   
   <sup>Originally posted by **GuruComposer** September 12, 2022</sup>
   ### Apache Airflow version
   
   2.3.4
   
   ### What happened
   
   I used to be able to use ipdb to debug DAGs by running `airflow tasks test <dag_name> <dag_id>`, and hitting an ipdb breakpoint (ipdb.set_trace()).
   
   This no longer works. I get a strange type error:
   
   ```  File "/usr/local/lib/python3.9/bdb.py", line 88, in trace_dispatch
       return self.dispatch_line(frame)
     File "/usr/local/lib/python3.9/bdb.py", line 112, in dispatch_line
       self.user_line(frame)
     File "/usr/local/lib/python3.9/pdb.py", line 262, in user_line
       self.interaction(frame, None)
     File "/home/astro/.local/lib/python3.9/site-packages/IPython/core/debugger.py", line 336, in interaction
       OldPdb.interaction(self, frame, traceback)
     File "/usr/local/lib/python3.9/pdb.py", line 357, in interaction
       self._cmdloop()
     File "/usr/local/lib/python3.9/pdb.py", line 322, in _cmdloop
       self.cmdloop()
     File "/usr/local/lib/python3.9/cmd.py", line 126, in cmdloop
       line = input(self.prompt)
   TypeError: an integer is required (got type NoneType)```
   
   
   
   ### What you think should happen instead
   
   I should get the ipdb shell.
   
   ### How to reproduce
   
   1. Add ipdb breakpoint anywhere in airflow task.
   import ipdb; ipdb.set_trace()
   
   2. Run that task:
   Run `airflow tasks test <dag_name> <dag_id>`, and 
   
   ### Operating System
   
   Debian GNU/Linux
   
   ### Versions of Apache Airflow Providers
   
   2.3.4


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

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


[GitHub] [airflow] ashb closed issue #26802: pdb no longer works with airflow test command since 2.3.3

Posted by GitBox <gi...@apache.org>.
ashb closed issue #26802: pdb no longer works with airflow test command since 2.3.3
URL: https://github.com/apache/airflow/issues/26802


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] ashb commented on issue #26802: pdb no longer works with airflow test command since 2.3.3

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

   Minimal repro:
   
   
   ```python
   from contextlib import redirect_stdout
   from airflow.utils.log.secrets_masker import RedactedIO
   
   
   with redirect_stdout(RedactedIO()):
       breakpoint()
       ...
   
   ```
   
   ```
   airflow ❯ python testredir.py   
   [0] > /home/ash/code/astro/upgrade-test-project/testredir.py(7)<module>()
   -> ...
   Traceback (most recent call last):
     File "/home/ash/code/astro/upgrade-test-project/testredir.py", line 7, in <module>
       ...
     File "/home/ash/code/astro/upgrade-test-project/testredir.py", line 7, in <module>
       ...
     File "/usr/lib/python3.10/bdb.py", line 90, in trace_dispatch
       return self.dispatch_line(frame)
     File "/usr/lib/python3.10/bdb.py", line 114, in dispatch_line
       self.user_line(frame)
     File "/usr/lib/python3.10/pdb.py", line 262, in user_line
       self.interaction(frame, None)
     File "/home/ash/.virtualenvs/airflow/lib/python3.10/site-packages/pdb.py", line 231, in interaction
       self._cmdloop()
     File "/usr/lib/python3.10/pdb.py", line 322, in _cmdloop
       self.cmdloop()
     File "/usr/lib/python3.10/cmd.py", line 126, in cmdloop
       line = input(self.prompt)
   TypeError: 'NoneType' object cannot be interpreted as an integer
   ```


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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