You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/03 17:58:25 UTC

[GitHub] [airflow] lindsable commented on a change in pull request #6075: [AIRFLOW-5266] Allow aws_athena_hook to get all query results

lindsable commented on a change in pull request #6075: [AIRFLOW-5266] Allow aws_athena_hook to get all query results
URL: https://github.com/apache/airflow/pull/6075#discussion_r374250964
 
 

 ##########
 File path: airflow/providers/amazon/aws/hooks/athena.py
 ##########
 @@ -133,7 +133,17 @@ def get_query_results(self, query_execution_id):
         elif query_state in self.INTERMEDIATE_STATES or query_state in self.FAILURE_STATES:
             self.log.error('Query is in {state} state. Cannot fetch results'.format(state=query_state))
             return None
-        return self.get_conn().get_query_results(QueryExecutionId=query_execution_id)
+        result_params = {'QueryExecutionId': query_execution_id,
+                         'MaxResults': max_results}
+        results = self.get_conn().get_query_results(**result_params)
 
 Review comment:
   Yes that does make sense.  Now that I think about it, it probably makes sense to just add a new function to check that the query is successful and then return the paginator. For the get_query_results function maybe we should just adding the option to send in the NextTokenId so you can paginate manually if you want. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services