class_docstr: Interact with Amazon Athena.
  
  Provide thick wrapper around
  :external+boto3:py:class:`boto3.client("athena") <Athena.Client>`.
  
  :param sleep_time: obsolete, please use the parameter of `poll_query_status` method instead
  :param log_query: Whether to log athena query and other execution params
      when it's executed. Defaults to *True*.
  
  Additional arguments (such as ``aws_conn_id``) may be specified and
  are passed down to the underlying AwsBaseHook.
  
  .. seealso::
      - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
class_docstr_tok: ["Interact","with","Amazon","Athena",".","Provide","thick","wrapper","around",":","external+boto3",":","py",":","class",":","`","boto3.client","(","``","athena","''",")","<","Athena.Client",">","`",".",":","param","sleep_time",":","obsolete",",","please","use","the","parameter","of","`","poll_query_status","`","method","instead",":","param","log_query",":","Whether","to","log","athena","query","and","other","execution","params","when","it","'s","executed",".","Defaults","to","*","True","*",".","Additional","arguments","(","such","as","``","aws_conn_id","``",")","may","be","specified","and","are","passed","down","to","the","underlying","AwsBaseHook",".","..","seealso",":",":","-",":","class",":","`","airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook","`"]
docstr: Fetch the reason for a state change (e.g. error message). Returns None or reason string.
  
  .. seealso::
      - :external+boto3:py:meth:`Athena.Client.get_query_execution`
  
  :param query_execution_id: Id of submitted athena query
docstr_tok: ["Fetch","the","reason","for","a","state","change","(","e.g",".","error","message",")",".","Returns","None","or","reason","string",".","..","seealso",":",":","-",":","external+boto3",":","py",":","meth",":","`","Athena.Client.get_query_execution","`",":","param","query_execution_id",":","Id","of","submitted","athena","query"]
code: def get_state_change_reason(
      self, query_execution_id: str, use_cache: bool = False
  ) -> str | None:
      """
      Fetch the reason for a state change (e.g. error message). Returns None or reason string.
  
      .. seealso::
          - :external+boto3:py:meth:`Athena.Client.get_query_execution`
  
      :param query_execution_id: Id of submitted athena query
      """
      response = self.get_query_info(
          query_execution_id=query_execution_id, use_cache=use_cache
      )
      reason = None
      try:
          reason = response["QueryExecution"]["Status"][
              "StateChangeReason"
          ]
      except Exception:
          self.log.exception(
              "Exception while getting query state change reason. Query execution id: %s",
              query_execution_id,
          )
      finally:
          # The error is being absorbed here and is being handled by the caller.
          # The error is being absorbed to implement retries.
          return reason
  
file_path: airflow/airflow/providers/amazon/aws/hooks/athena.py
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING, Any
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.utils.waiter_with_logging import wait
label_desc: Use image node_id 5 for calling the AthenaHook obj's underlying member method code with example usage: obj.get_state_change_reason(query_execution_id, use_cache) and returns: reason