ephraimbuddy commented on code in PR #54505:
URL: https://github.com/apache/airflow/pull/54505#discussion_r2564492303


##########
airflow-core/src/airflow/exceptions.py:
##########
@@ -21,121 +21,66 @@
 
 from __future__ import annotations
 
-from collections.abc import Collection, Sequence
-from datetime import datetime, timedelta
 from http import HTTPStatus
-from typing import TYPE_CHECKING, Any, NamedTuple
+from typing import TYPE_CHECKING, NamedTuple
 
 if TYPE_CHECKING:
     from airflow.models import DagRun
-    from airflow.sdk.definitions.asset import AssetNameRef, AssetUniqueKey, 
AssetUriRef
-    from airflow.utils.state import DagRunState
 
 # Re exporting AirflowConfigException from shared configuration
 from airflow._shared.configuration.exceptions import AirflowConfigException as 
AirflowConfigException
 
+try:
+    from airflow.sdk.exceptions import (
+        AirflowException,
+        AirflowNotFoundException,
+        AirflowRescheduleException,
+        TaskNotFound,
+    )
+except ModuleNotFoundError:
+    # When _AIRFLOW__AS_LIBRARY is set, airflow.sdk may not be installed.
+    # In that case, we define fallback exception classes that mirror the SDK 
ones.

Review Comment:
   This one is about _AIRFLOW__AS_LIBRARY cause that's only when we could have 
this issue.  Not compat for versions <3.2. 



-- 
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]

Reply via email to