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:
[email protected]
With regards,
Apache Git Services