Taragolis commented on PR #27337:
URL: https://github.com/apache/airflow/pull/27337#issuecomment-1294634684

   Finally I could reproduce this error locally. 
   
   I do not know about actual nature of this error but what I found
   * Error not happen in case of `exceptiongroup==1.0.0rc9`
   * `exceptiongroup` monkey patch `traceback.TracebackException` on import as 
result tests not failed if no `import exceptiongroup`. However this test run in 
the end of all `Test: Core`
   * In PyCharm Debugger with Python 3.9.9 `caplog.text` returns expected 
value. I thought Debugger also might monkey patch `traceback.TracebackException`
   
   ```
   ERROR Err
   Traceback (most recent call last):
     File ".../test_secrets_masker.py", line 165, in 
test_masking_in_implicit_context_exceptions
       raise RuntimeError(f"Cannot connect to user:{p}")
   RuntimeError: Cannot connect to user:***
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File ".../test_secrets_masker.py", line 167, in 
test_masking_in_implicit_context_exceptions
       raise RuntimeError(f"Exception: {ex1}")
   RuntimeError: Exception: Cannot connect to user:***
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File ".../test_secrets_masker.py", line 169, in 
test_masking_in_implicit_context_exceptions
       raise RuntimeError(f"Exception: {ex2}")
   RuntimeError: Exception: Exception: Cannot connect to user:***
   ```
   
   * In the other hand `pytest` get this value.
   
   ```
   ERROR Err
   Traceback (most recent call last):
     File ".../test_secrets_masker.py", line 167, in 
test_masking_in_implicit_context_exceptions
       raise RuntimeError(f"Exception: {ex1}")
   RuntimeError: Exception: Cannot connect to user:***
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File ".../test_secrets_masker.py", line 169, in 
test_masking_in_implicit_context_exceptions
       raise RuntimeError(f"Exception: {ex2}")
   RuntimeError: Exception: Exception: Cannot connect to user:***
   ```
   
   * Set env var `EXCEPTIONGROUP_NO_PATCH` to `1` not help
   * Add parameter `--tb=native` to `pytest` run not help
   
   * `exceptiongroup` is dependency of cattrs
   ```shell
   root@4b131dd73f72:/opt/airflow# pipdeptree --reverse --packages 
exceptiongroup --python `which python`
   exceptiongroup==1.0.0rc9
     - cattrs==22.2.0 [requires: exceptiongroup]
       - apache-airflow==2.5.0.dev0 [requires: cattrs>=22.1.0]
       - looker-sdk==22.18.0 [requires: cattrs>=1.3]
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to