mobuchowski commented on code in PR #66844:
URL: https://github.com/apache/airflow/pull/66844#discussion_r3246911722


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:
##########
@@ -177,6 +177,36 @@ def _get_conn_params(self) -> dict[str, str | None]:
             aws_domain=self.conn.extra_dejson.get("aws_domain", 
"amazonaws.com"),
         )
 
+    def get_openlineage_database_info(self, connection):
+        """Return Amazon Athena specific information for OpenLineage."""
+        from airflow.providers.openlineage.sqlparser import DatabaseInfo
+
+        region_name = connection.extra_dejson.get("region_name") or 
self.region_name

Review Comment:
   shouldn't this be the other way around? `self.region_name or 
connection.extra_dejson.get("region_name")`?



##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:
##########
@@ -177,6 +177,36 @@ def _get_conn_params(self) -> dict[str, str | None]:
             aws_domain=self.conn.extra_dejson.get("aws_domain", 
"amazonaws.com"),
         )
 
+    def get_openlineage_database_info(self, connection):
+        """Return Amazon Athena specific information for OpenLineage."""
+        from airflow.providers.openlineage.sqlparser import DatabaseInfo
+
+        region_name = connection.extra_dejson.get("region_name") or 
self.region_name
+        authority = f"athena.{region_name}.amazonaws.com" if region_name else 
"athena.amazonaws.com"

Review Comment:
   ```suggestion
           aws_domain = connection.extra_dejson.get("aws_domain", 
"amazonaws.com")
           authority = f"athena.{region_name}.{aws_domain}" if region_name else 
"athena.{aws_domain}"
   ```



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