Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions airflow/models/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
# under the License.
from __future__ import annotations

import warnings

from sqlalchemy import Column, Integer, String, Text

from airflow.exceptions import RemovedInAirflow3Warning
from airflow.models.base import Base
from airflow.utils.sqlalchemy import UtcDateTime

Expand All @@ -35,17 +32,3 @@ class ParseImportError(Base):
filename = Column(String(1024))
stacktrace = Column(Text)
processor_subdir = Column(String(2000), nullable=True)


def __getattr__(name: str):
# PEP-562: Lazy loaded attributes on python modules
if name == "ImportError":
warnings.warn(
f"Model class '{__name__}.ImportError' is deprecated due to shadowing with builtin exception "
f"ImportError and will be removed in the future. "
f"Please consider to use '{__name__}.ParseImportError' instead.",
RemovedInAirflow3Warning,
stacklevel=2,
)
return ParseImportError
raise AttributeError(f"module {__name__} has no attribute {name}")
1 change: 1 addition & 0 deletions newsfragments/41779.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated support for ``airflow.models.errors.ImportError`` which has been renamed to ``ParseImportError``.
2 changes: 1 addition & 1 deletion tests/test_utils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# all providers are updated to airflow 2.10+.
from airflow.models.errors import ParseImportError
except ImportError:
from airflow.models.errors import ImportError as ParseImportError # type: ignore[no-redef]
from airflow.models.errors import ImportError as ParseImportError # type: ignore[no-redef,attr-defined]


from airflow import __version__ as airflow_version
Expand Down