Boto3: Support AWS Athena waiter feature

Created on 8 Aug 2017  Â·  38Comments  Â·  Source: boto/boto3

Hi,

If you go to
https://boto3.readthedocs.io/en/latest/reference/services/athena.html#Athena.Client.get_waiter
looks like that feature is not implemented.

I have a lambda function which executes Athena queries. I use a function called start_query_execution() in boto3 and I need to write a loop to check if the execution is finished or not, so I think it will be awesome if we have waiter feature implemented in Athena.

Thanks

feature-request waiters

Most helpful comment

Could we at least remove this reference from the boto3 docs if it's not going to be implemented?

It's confusing to have this comment "See the waiters section of the service docs for a list of available waiters." when that list doesn't appear to exist.

All 38 comments

Marking this as a feature request. Thanks for your input!

Any updates on this?

+1

+1

+1

Isn't this implemented yet?

+1

+1

+1

+1

Has anyone written one of these? Looks like just a matter of calling start_query_execution() which returns a QueryExecutionId then calling get_query_execution() with that QueryExecutionId until the status is one of the 'SUCCEEDED', 'FAILED', 'CANCELLED'
Probably with some delays between polling. Is there anything else to consider?

Hopefully this will be added to Boto3 soon

@tomvachon thanks for the link I wasn't aware of that one, super helpful.

There is a pull request for this feature (boto/botocore#1358) open for this feature since 2018-01-09. Would be great to get it merged!

+1

+1

+1

+1

+1 for sure

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

Could we at least remove this reference from the boto3 docs if it's not going to be implemented?

It's confusing to have this comment "See the waiters section of the service docs for a list of available waiters." when that list doesn't appear to exist.

Is this necessary, if one can use the S3 waiter for the output file created by the query execution?

Hi @marias0l, the doc of S3.Waiter.ObjectExists states that the s3 waiter “Polls S3.Client.head_object() every 5 seconds until a successful state is reached. An error is returned after 20 failed checks”. It is very probable that an Athena query lasts longer than 100 seconds so I guess this approach won’t work.

That can be configured with WaiterConfig like:
waiter.wait( Bucket='string', WaiterConfig={ 'Delay': 123, 'MaxAttempts': 123 } )

Was this page helpful?
0 / 5 - 0 ratings