sgoel2be24-cyber opened a new pull request, #71691: URL: https://github.com/apache/airflow/pull/71691
<!-- Thank you for contributing! Please read the contribution guidelines first: https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst --> ### Description In `airflow.utils.helpers`, `__getattr__` resolves deprecated imports from `__deprecated_imports` by calling `__import__(modpath)`. Because `__import__` on dotted paths without a `fromlist` returns the top-level module (`airflow`) rather than the target submodule (e.g. `airflow.sdk.definitions.context`), attempting to import moved functions such as `from airflow.utils.helpers import render_template_as_native` raised `ImportError`. This PR changes `__getattr__` to use `importlib.import_module(modpath)` so that dotted submodules are imported correctly while preserving the deprecation warning. ### Tests - Added `test_deprecated_imports` and `test_deprecated_imports_unknown_attribute` to `airflow-core/tests/unit/utils/test_helpers.py`. - All 28 tests in `test_helpers.py` pass. -- 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]
