shahar1 commented on code in PR #60808:
URL: https://github.com/apache/airflow/pull/60808#discussion_r2709760595
##########
task-sdk/src/airflow/sdk/__init__.py:
##########
@@ -176,7 +179,13 @@ def __getattr__(name: str):
import importlib
mod = importlib.import_module(module_path, __name__)
- val = getattr(mod, name)
+
+ # try and get the attribute from the module
+ # if it doesn't exist (for modules like macros), return module itself
+ try:
+ val = getattr(mod, name)
+ except AttributeError:
+ val = mod
Review Comment:
> Hmm, I could do that yes, but I do not see why it will backfire, we
already use similar patterns for `from airflow import version` or similar
Not a strong objection (maybe I'm extra cautious) - as long as we aware
what's going on in the init files I guess that we should be fine.
Fix the failing test and I'll approve.
--
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]