class_docstr: An operator that submits a Trino/Presto query to Amazon Athena.
  
  .. note:: if the task is killed while it runs, it'll cancel the athena query that was launched,
      EXCEPT if running in deferrable mode.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:AthenaOperator`
  
  :param query: Trino/Presto query to be run on Amazon Athena. (templated)
  :param database: Database to select. (templated)
  :param catalog: Catalog to select. (templated)
  :param output_location: s3 path to write the query results into. (templated)
      To run the query, you must specify the query results location using one of the ways:
      either for individual queries using either this setting (client-side),
      or in the workgroup, using WorkGroupConfiguration.
      If none of them is set, Athena issues an error that no output location is provided
  :param client_request_token: Unique token created by user to avoid multiple executions of same query
  :param workgroup: Athena workgroup in which query will be run. (templated)
  :param query_execution_context: Context in which query need to be run
  :param result_configuration: Dict with path to store results in and config related to encryption
  :param sleep_time: Time (in seconds) to wait between two consecutive calls to check query status on Athena
  :param max_polling_attempts: Number of times to poll for query state before function exits
      To limit task execution time, use execution_timeout.
  :param log_query: Whether to log athena query and other execution params when it's executed.
      Defaults to *True*.
  :param aws_conn_id: The Airflow connection used for AWS credentials.
      If this is ``None`` or empty then the default boto3 behaviour is used. If
      running Airflow in a distributed manner and aws_conn_id is None or
      empty, then default boto3 configuration would be used (and must be
      maintained on each worker node).
  :param region_name: AWS region_name. If not specified then the default boto3 behaviour is used.
  :param verify: Whether or not to verify SSL certificates. See:
      https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
  :param botocore_config: Configuration dictionary (key-values) for botocore client. See:
      https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
class_docstr_tok: ["An","operator","that","submits","a","Trino\/Presto","query","to","Amazon","Athena",".","..","note",":",":","if","the","task","is","killed","while","it","runs",",","it","'ll","cancel","the","athena","query","that","was","launched",",","EXCEPT","if","running","in","deferrable","mode",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","AthenaOperator","`",":","param","query",":","Trino\/Presto","query","to","be","run","on","Amazon","Athena",".","(","templated",")",":","param","database",":","Database","to","select",".","(","templated",")",":","param","catalog",":","Catalog","to","select",".","(","templated",")",":","param","output_location",":","s3","path","to","write","the","query","results","into",".","(","templated",")","To","run","the","query",",","you","must","specify","the","query","results","location","using","one","of","the","ways",":","either","for","individual","queries","using","either","this","setting","(","client-side",")",",","or","in","the","workgroup",",","using","WorkGroupConfiguration",".","If","none","of","them","is","set",",","Athena","issues","an","error","that","no","output","location","is","provided",":","param","client_request_token",":","Unique","token","created","by","user","to","avoid","multiple","executions","of","same","query",":","param","workgroup",":","Athena","workgroup","in","which","query","will","be","run",".","(","templated",")",":","param","query_execution_context",":","Context","in","which","query","need","to","be","run",":","param","result_configuration",":","Dict","with","path","to","store","results","in","and","config","related","to","encryption",":","param","sleep_time",":","Time","(","in","seconds",")","to","wait","between","two","consecutive","calls","to","check","query","status","on","Athena",":","param","max_polling_attempts",":","Number","of","times","to","poll","for","query","state","before","function","exits","To","limit","task","execution","time",",","use","execution_timeout",".",":","param","log_query",":","Whether","to","log","athena","query","and","other","execution","params","when","it","'s","executed",".","Defaults","to","*","True","*",".",":","param","aws_conn_id",":","The","Airflow","connection","used","for","AWS","credentials",".","If","this","is","``","None","``","or","empty","then","the","default","boto3","behaviour","is","used",".","If","running","Airflow","in","a","distributed","manner","and","aws_conn_id","is","None","or","empty",",","then","default","boto3","configuration","would","be","used","(","and","must","be","maintained","on","each","worker","node",")",".",":","param","region_name",":","AWS","region_name",".","If","not","specified","then","the","default","boto3","behaviour","is","used",".",":","param","verify",":","Whether","or","not","to","verify","SSL","certificates",".","See",":","https",":","\/\/boto3.amazonaws.com\/v1\/documentation\/api\/latest\/reference\/core\/session.html",":","param","botocore_config",":","Configuration","dictionary","(","key-values",")","for","botocore","client",".","See",":","https",":","\/\/botocore.amazonaws.com\/v1\/documentation\/api\/latest\/reference\/config.html"]
code: def execute_complete(self, context, event=None):
      if event["status"] != "success":
          raise AirflowException(
              f"Error while waiting for operation on cluster to complete: {event}"
          )
      return event["value"]
  
file_path: airflow/airflow/providers/amazon/aws/operators/athena.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Sequence
  from urllib.parse import urlparse
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.providers.amazon.aws.hooks.athena import AthenaHook
  from airflow.providers.amazon.aws.links.athena import AthenaQueryResultsLink
  from airflow.providers.amazon.aws.operators.base_aws import AwsBaseOperator
  from airflow.providers.amazon.aws.triggers.athena import AthenaTrigger
  from airflow.providers.amazon.aws.utils.mixins import aws_template_fields
label_desc: Use image node_id 4 for calling the AthenaOperator obj's underlying member method code with example usage: obj.execute_complete(context, event) and returns: event