Lee-W commented on code in PR #43773:
URL: https://github.com/apache/airflow/pull/43773#discussion_r1844906243


##########
providers/tests/amazon/aws/auth_manager/test_aws_auth_manager.py:
##########
@@ -57,9 +57,25 @@
     from airflow.auth.managers.models.resource_details import AssetDetails
     from airflow.security.permissions import RESOURCE_ASSET
 else:
-    from airflow.providers.common.compat.assets import AssetDetails
     from airflow.providers.common.compat.security.permissions import 
RESOURCE_ASSET
 
+    # TODO: Remove this try-exception block after bumping common provider to 
1.3.0
+    # This is due to common provider AssetDetails import error handling
+    try:
+        from airflow.auth.managers.models.resource_details import AssetDetails
+    except ModuleNotFoundError:
+        # 2.7.x
+        pass
+    except ImportError:
+        from packaging.version import Version
+
+        from airflow import __version__ as AIRFLOW_VERSION
+
+        _IS_AIRFLOW_2_8_OR_HIGHER = 
Version(Version(AIRFLOW_VERSION).base_version) >= Version("2.8.0")
+        if _IS_AIRFLOW_2_8_OR_HIGHER:
+            from airflow.auth.managers.models.resource_details import 
DatasetDetails as AssetDetails

Review Comment:
   yep, just removed it and let it handled it the provider code. Thanks!



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