diff --git a/airflow-core/src/airflow/utils/helpers.py b/airflow-core/src/airflow/utils/helpers.py index 73265463edc9b..b9efda28b148c 100644 --- a/airflow-core/src/airflow/utils/helpers.py +++ b/airflow-core/src/airflow/utils/helpers.py @@ -313,6 +313,7 @@ def __getattr__(name: str): except KeyError: raise AttributeError(f"module '{__name__}' has no attribute '{name}'") from None + import importlib import warnings warnings.warn( @@ -320,4 +321,4 @@ def __getattr__(name: str): DeprecationWarning, stacklevel=2, ) - return getattr(__import__(modpath), name) + return getattr(importlib.import_module(modpath), name)