[ 
https://issues.apache.org/jira/browse/AIRFLOW-5266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17152587#comment-17152587
 ] 

ASF GitHub Bot commented on AIRFLOW-5266:
-----------------------------------------

ashb commented on a change in pull request #6075:
URL: https://github.com/apache/airflow/pull/6075#discussion_r450721463



##########
File path: tests/providers/amazon/aws/hooks/test_athena.py
##########
@@ -0,0 +1,172 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+import unittest
+from unittest import mock
+
+from airflow.providers.amazon.aws.hooks.athena import AWSAthenaHook
+
+MOCK_DATA = {
+    'query': 'SELECT * FROM TEST_TABLE',
+    'database': 'TEST_DATABASE',
+    'outputLocation': 's3://test_s3_bucket/',
+    'client_request_token': 'eac427d0-1c6d-4dfb-96aa-2835d3ac6595',
+    'workgroup': 'primary',
+    'query_execution_id': 'eac427d0-1c6d-4dfb-96aa-2835d3ac6595',
+    'next_token_id': 'eac427d0-1c6d-4dfb-96aa-2835d3ac6595',
+    'max_items': 1000
+}
+
+mock_query_context = {
+    'Database': MOCK_DATA['database']
+}
+mock_result_configuration = {
+    'OutputLocation': MOCK_DATA['outputLocation']
+}
+
+MOCK_RUNNING_QUERY_EXECUTION = {'QueryExecution': {'Status': {'State': 
'RUNNING'}}}
+MOCK_SUCCEEDED_QUERY_EXECUTION = {'QueryExecution': {'Status': {'State': 
'SUCCEEDED'}}}
+
+MOCK_QUERY_EXECUTION = {'QueryExecutionId': MOCK_DATA['query_execution_id']}
+
+
+class TestAWSAthenaHook(unittest.TestCase):
+
+    def setUp(self):
+        self.athena = AWSAthenaHook(sleep_time=1)

Review comment:
       Can we do sleep time=0 instead? (`sleep(0)` is valid) - This would 
probably make the tests run quicker.




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


> AWS Athena Hook only returns first 1000 results
> -----------------------------------------------
>
>                 Key: AIRFLOW-5266
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5266
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: aws, contrib, hooks
>    Affects Versions: 1.10.4
>            Reporter: Lindsay Portelli
>            Assignee: Lindsay Portelli
>            Priority: Minor
>              Labels: easyfix, newbie, pull-request-available
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> When using the get_query_results function in the AWSAthenaHook, you will only 
> get the first 1000 results for a given query execution id. See the [boto3 
> documentation|https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html?highlight=start_query_execution#Athena.Client.get_query_results]
> I'll be creating a pr in the next few days.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to