Skip to content

Commit 4231a87

Browse files
authored
Deprecate airflow.utils.warnings properly (#53339)
1 parent 00194da commit 4231a87

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

airflow-core/src/airflow/utils/__init__.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@
2020

2121
from airflow.utils.deprecation_tools import add_deprecated_classes
2222

23-
24-
def _deprecate_this_module(message: str, **shims: tuple[str, str]):
25-
import warnings
26-
27-
from airflow.exceptions import RemovedInAirflow4Warning
28-
29-
warnings.warn(message, RemovedInAirflow4Warning, stacklevel=3)
30-
31-
def __getattr__(name: str):
32-
try:
33-
impa, attr = shims[name]
34-
except KeyError:
35-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
36-
return getattr(__import__(impa), attr)
37-
38-
return __getattr__
39-
40-
4123
__deprecated_classes = {
4224
"setup_teardown": {
4325
"BaseSetupTeardownContext": "airflow.sdk.definitions._internal.setup_teardown.BaseSetupTeardownContext",
@@ -47,4 +29,5 @@ def __getattr__(name: str):
4729
"XCOM_RETURN_KEY": "airflow.models.xcom.XCOM_RETURN_KEY",
4830
},
4931
}
32+
5033
add_deprecated_classes(__deprecated_classes, __name__)

airflow-core/src/airflow/utils/warnings.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)