I want to use the boto3 athena client function start_query_execution to run a query from Python. Function docs here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.start_query_execution
Usage would be something like:
query = "SELECT * FROM TABLE"
athena_client = boto3.client("athena")
start_response = athena_client.start_query_execution(
QueryString=query,
QueryExecutionContext={"Database": ATHENA.database_name},
ResultConfiguration={
"OutputLocation": s3_output,
},
)
I'm looking for a function / wrapper that ensures this query runs successfully and only returns once it has run to completion. Couldn't find an aws wrapper from my search.