JDarDagran commented on code in PR #35090:
URL: https://github.com/apache/airflow/pull/35090#discussion_r1374477084


##########
airflow/providers/amazon/aws/hooks/athena.py:
##########
@@ -121,7 +122,26 @@ def run_query(
         self.log.info("Query execution id: %s", query_execution_id)
         return query_execution_id
 
-    def check_query_status(self, query_execution_id: str) -> str | None:
+    def get_query_execution(self, query_execution_id: str, 
use_cached_response: bool = False) -> dict:
+        """Get information about a single execution of a query.
+
+        .. seealso::
+            - :external+boto3:py:meth:`Athena.Client.get_query_execution`
+
+        :param query_execution_id: Id of submitted athena query
+        :param use_cached_response: If True, use execution information cache
+        """
+        # second check if to satisfy mypy
+        if use_cached_response or not hasattr(self._get_query_execution, 
"__wrapped__"):
+            return 
self._get_query_execution(query_execution_id=query_execution_id)
+        return self._get_query_execution.__wrapped__(self, 
query_execution_id=query_execution_id)

Review Comment:
   It might look hacky, I agree.
   Motivation was to use Python's caching implementation which is well 
documented imho but it's too simple and readable to replace it with your 
suggestion.
   
   Changed.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to