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


##########
airflow-core/src/airflow/exceptions.py:
##########
@@ -21,32 +21,38 @@
 
 from __future__ import annotations
 
-from collections.abc import Collection, Sequence
-from datetime import datetime, timedelta
+import os
 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
 
+# When _AIRFLOW__AS_LIBRARY is set, airflow.sdk may not be installed

Review Comment:
   Instead of checking for this, would it be better to try to import sdk and 
fall back on ImportError? Even in library mode, SDK _might_ still be installed, 
and having two differetn definitions may cause some issues.



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