namanjain24-sudo commented on PR #74245:
URL: https://github.com/apache/airflow/pull/74245#issuecomment-6344150485

   Checked both points against the history — you're right on both.
   
   At #61350 `stats.py` still had `from airflow.observability.metrics import 
datadog_logger` (plus the
   statsd and otel equivalents) inside `Stats.initialize`, and 
`check_airflow_imports_in_shared.py` walks the
   full AST rather than module scope, so those function-local imports would 
have tripped it. #62127 then
   refactored them out and nothing has reintroduced an `airflow.*` import 
since, so the exemption has been
   dead weight since then. My #69270 explanation was wrong, and so was the 
#69172 claim — both are gone from
   the description and the commit message now.
   
   On `closes:` vs `related:` — agreed, and for the reason you give: the hook 
only inspects `ast.Import` and
   `ast.ImportFrom` nodes, with no handling for `import_module()` or 
`__import__()`, so it would still pass on
   a `stats.py` that reached into its consuming distribution dynamically. 
Switched to `related: #74072`.
   
   The diff itself is unchanged — the force-push only rewrites the commit 
message.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @namanjain24-sudo before 
posting
   


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