shahar1 commented on PR #76692:
URL: https://github.com/apache/airflow/pull/76692#issuecomment-6721907105

   > I found a small false positive in the new guard at 
[fcf6ec2](https://github.com/apache/airflow/commit/fcf6ec2638d0ecf3e8df2f8f280c91cdfdf02bfb).
 A symbol in the `else` branch of `if not TYPE_CHECKING` is unavailable at 
runtime, but `get_module_names()` reports it as present:
   > 
   > ```python
   > from typing import TYPE_CHECKING
   > 
   > if not TYPE_CHECKING:
   >     class Runtime:
   >         pass
   > else:
   >     class TypingOnly:
   >         pass
   > ```
   > 
   > I executed the module and the PR's exact helper against it. Only `Runtime` 
was bound at runtime, while the helper returned both names. Recognizing unary 
`not` around the existing `is_type_checking()` predicate and visiting only the 
body for that case matched runtime. Codex generated and ran this isolated check.
   
   Thanks for the feedback, fixed.


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