File tree 2 files changed +9
-20
lines changed
2 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -69,28 +69,13 @@ def import_all_models():
69
69
70
70
def __getattr__ (name ):
71
71
# PEP-562: Lazy loaded attributes on python modules
72
- if name != "ImportError" :
73
- path = __lazy_imports .get (name )
74
- if not path :
75
- raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
72
+ path = __lazy_imports .get (name )
73
+ if not path :
74
+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
76
75
77
- from airflow .utils .module_loading import import_string
76
+ from airflow .utils .module_loading import import_string
78
77
79
- val = import_string (f"{ path } .{ name } " )
80
- else :
81
- import warnings
82
-
83
- from airflow .exceptions import RemovedInAirflow3Warning
84
- from airflow .models .errors import ParseImportError
85
-
86
- warnings .warn (
87
- f"Import '{ __name__ } .ImportError' is deprecated due to shadowing with builtin exception "
88
- f"ImportError and will be removed in the future. "
89
- f"Please consider to use '{ ParseImportError .__module__ } .ParseImportError' instead." ,
90
- RemovedInAirflow3Warning ,
91
- stacklevel = 2 ,
92
- )
93
- val = ParseImportError
78
+ val = import_string (f"{ path } .{ name } " )
94
79
95
80
# Store for next time
96
81
globals ()[name ] = val
Original file line number Diff line number Diff line change
1
+ Deprecated ``ImportError `` removed from ``airflow.models ``
2
+
3
+ The deprecated ``ImportError `` class can no longer be imported from ``airflow.models ``.
4
+ It has been moved to ``airflow.models.errors.ParseImportError ``.
You can’t perform that action at this time.
0 commit comments