Taragolis commented on code in PR #34225:
URL: https://github.com/apache/airflow/pull/34225#discussion_r1320394242


##########
airflow/providers/amazon/aws/links/emr.py:
##########
@@ -66,3 +81,100 @@ def get_log_uri(
         return None
     log_uri = S3Hook.parse_s3_url(cluster_info["LogUri"])
     return "/".join(log_uri)
+
+
+class EmrServerlessLogsLink(BaseAwsLink):
+    """Helper class for constructing Amazon EMR Serverless Logs Link."""
+
+    name = "Spark Driver stdout"
+    key = "emr_serverless_logs"
+
+    def get_link(
+        self,
+        operator: BaseOperator,
+        *,
+        ti_key: TaskInstanceKey,
+    ) -> str:
+        """
+        Link to Amazon Web Services Console.
+
+        :param operator: airflow operator
+        :param ti_key: TaskInstance ID to return link for
+        :return: link to external system
+        """
+        conf = XCom.get_value(key=self.key, ti_key=ti_key)
+        if not conf:
+            return ""
+        conn_id = operator.aws_conn_id
+        hook = EmrServerlessHook(aws_conn_id=conn_id)

Review Comment:
   Is it actually work with something rather then "aws_default" ?



##########
airflow/providers/amazon/aws/links/emr.py:
##########
@@ -16,27 +16,32 @@
 # under the License.
 from __future__ import annotations
 
-from typing import TYPE_CHECKING, Any
+from typing import Any, TYPE_CHECKING
+from airflow.models import XCom
+
+if TYPE_CHECKING:
+    import boto3
+
+    from airflow.models import BaseOperator
+    from airflow.models.taskinstancekey import TaskInstanceKey

Review Comment:
   It should be moved in the end of imports



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