class_docstr: Executes an SQL statement in a given SQL connection and sends the results to Slack API as file.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:SqlToSlackApiFileOperator`
  
  :param sql: The SQL query to be executed
  :param sql_conn_id: reference to a specific DB-API Connection.
  :param slack_conn_id: :ref:`Slack API Connection <howto/connection:slack>`.
  :param slack_filename: Filename for display in slack.
      Should contain supported extension which referenced to ``SUPPORTED_FILE_FORMATS``.
      It is also possible to set compression in extension:
      ``filename.csv.gzip``, ``filename.json.zip``, etc.
  :param sql_hook_params: Extra config params to be passed to the underlying hook.
      Should match the desired hook constructor params.
  :param parameters: The parameters to pass to the SQL query.
  :param slack_channels: Comma-separated list of channel names or IDs where the file will be shared.
       If omitting this parameter, then file will send to workspace.
  :param slack_initial_comment: The message text introducing the file in specified ``slack_channels``.
  :param slack_title: Title of file.
  :param slack_base_url: A string representing the Slack API base URL. Optional
  :param df_kwargs: Keyword arguments forwarded to ``pandas.DataFrame.to_{format}()`` method.
code: def execute(self, context: Context) -> None:
      # Parse file format from filename
      output_file_format, _ = parse_filename(
          filename=self.slack_filename,
          supported_file_formats=self.SUPPORTED_FILE_FORMATS,
      )
  
      slack_hook = SlackHook(
          slack_conn_id=self.slack_conn_id,
          base_url=self.slack_base_url,
          timeout=self.slack_timeout,
          proxy=self.slack_proxy,
          retry_handlers=self.slack_retry_handlers,
      )
      with NamedTemporaryFile(
          mode="w+", suffix=f"_{self.slack_filename}"
      ) as fp:
          # tempfile.NamedTemporaryFile used only for create and remove temporary file,
          # pandas will open file in correct mode itself depend on file type.
          # So we close file descriptor here for avoid incidentally write anything.
          fp.close()
  
          output_file_name = fp.name
          output_file_format = output_file_format.upper()
          df_result = self._get_query_results()
          if output_file_format == "CSV":
              df_result.to_csv(output_file_name, **self.df_kwargs)
          elif output_file_format == "JSON":
              df_result.to_json(output_file_name, **self.df_kwargs)
          elif output_file_format == "HTML":
              df_result.to_html(output_file_name, **self.df_kwargs)
          else:
              # Not expected that this error happen. This only possible
              # if SUPPORTED_FILE_FORMATS extended and no actual implementation for specific format.
              raise AirflowException(
                  f"Unexpected output file format: {output_file_format}"
              )
  
          slack_hook.send_file(
              channels=self.slack_channels,
              file=output_file_name,
              filename=self.slack_filename,
              initial_comment=self.slack_initial_comment,
              title=self.slack_title,
          )
  
file_path: airflow/airflow/providers/slack/transfers/sql_to_slack.py
imports: from __future__ import annotations
  import warnings
  from tempfile import NamedTemporaryFile
  from typing import TYPE_CHECKING, Any, Mapping, Sequence
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.slack.hooks.slack import SlackHook
  from airflow.providers.slack.transfers.base_sql_to_slack import BaseSqlToSlackOperator
  from airflow.providers.slack.transfers.sql_to_slack_webhook import SqlToSlackWebhookOperator
  from airflow.providers.slack.utils import parse_filename
label_desc: Use image node_id 2 for calling the SqlToSlackApiFileOperator obj's underlying member method code with example usage: obj.execute(context) without return types