class_docstr: Saves data from a specific SQL query into a file in S3.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:SqlToS3Operator`
  
  :param query: the sql query to be executed. If you want to execute a file, place the absolute path of it,
      ending with .sql extension. (templated)
  :param s3_bucket: bucket where the data will be stored. (templated)
  :param s3_key: desired key for the file. It includes the name of the file. (templated)
  :param replace: whether or not to replace the file in S3 if it previously existed
  :param sql_conn_id: reference to a specific database.
  :param sql_hook_params: Extra config params to be passed to the underlying hook.
      Should match the desired hook constructor params.
  :param parameters: (optional) the parameters to render the SQL query with.
  :param aws_conn_id: reference to a specific S3 connection
  :param verify: Whether or not to verify SSL certificates for S3 connection.
      By default SSL certificates are verified.
      You can provide the following values:
  
      - ``False``: do not validate SSL certificates. SSL will still be used
              (unless use_ssl is False), but SSL certificates will not be verified.
      - ``path/to/cert/bundle.pem``: A filename of the CA cert bundle to uses.
              You can specify this argument if you want to use a different
              CA cert bundle than the one used by botocore.
  :param file_format: the destination file format, only string 'csv', 'json' or 'parquet' is accepted.
  :param pd_kwargs: arguments to include in DataFrame ``.to_parquet()``, ``.to_json()`` or ``.to_csv()``.
  :param groupby_kwargs: argument to include in DataFrame ``groupby()``.
class_docstr_tok: ["Saves","data","from","a","specific","SQL","query","into","a","file","in","S3",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","SqlToS3Operator","`",":","param","query",":","the","sql","query","to","be","executed",".","If","you","want","to","execute","a","file",",","place","the","absolute","path","of","it",",","ending","with",".sql","extension",".","(","templated",")",":","param","s3_bucket",":","bucket","where","the","data","will","be","stored",".","(","templated",")",":","param","s3_key",":","desired","key","for","the","file",".","It","includes","the","name","of","the","file",".","(","templated",")",":","param","replace",":","whether","or","not","to","replace","the","file","in","S3","if","it","previously","existed",":","param","sql_conn_id",":","reference","to","a","specific","database",".",":","param","sql_hook_params",":","Extra","config","params","to","be","passed","to","the","underlying","hook",".","Should","match","the","desired","hook","constructor","params",".",":","param","parameters",":","(","optional",")","the","parameters","to","render","the","SQL","query","with",".",":","param","aws_conn_id",":","reference","to","a","specific","S3","connection",":","param","verify",":","Whether","or","not","to","verify","SSL","certificates","for","S3","connection",".","By","default","SSL","certificates","are","verified",".","You","can","provide","the","following","values",":","-","``","False","``",":","do","not","validate","SSL","certificates",".","SSL","will","still","be","used","(","unless","use_ssl","is","False",")",",","but","SSL","certificates","will","not","be","verified",".","-","``","path\/to\/cert\/bundle.pem","``",":","A","filename","of","the","CA","cert","bundle","to","uses",".","You","can","specify","this","argument","if","you","want","to","use","a","different","CA","cert","bundle","than","the","one","used","by","botocore",".",":","param","file_format",":","the","destination","file","format",",","only","string","'csv","'",",","'json","'","or","'parquet","'","is","accepted",".",":","param","pd_kwargs",":","arguments","to","include","in","DataFrame","``",".to_parquet","(",")","``",",","``",".to_json","(",")","``","or","``",".to_csv","(",")","``",".",":","param","groupby_kwargs",":","argument","to","include","in","DataFrame","``","groupby","(",")","``","."]
code: def execute(self, context: Context) -> None:
      sql_hook = self._get_hook()
      s3_conn = S3Hook(aws_conn_id=self.aws_conn_id, verify=self.verify)
      data_df = sql_hook.get_pandas_df(
          sql=self.query, parameters=self.parameters
      )
      self.log.info("Data from SQL obtained")
  
      self._fix_dtypes(data_df, self.file_format)
      file_options = FILE_OPTIONS_MAP[self.file_format]
  
      for group_name, df in self._partition_dataframe(df=data_df):
          with NamedTemporaryFile(
              mode=file_options.mode, suffix=file_options.suffix
          ) as tmp_file:
              self.log.info("Writing data to temp file")
              getattr(df, file_options.function)(
                  tmp_file.name, **self.pd_kwargs
              )
  
              self.log.info("Uploading data to S3")
              object_key = (
                  f"{self.s3_key}_{group_name}"
                  if group_name
                  else self.s3_key
              )
              s3_conn.load_file(
                  filename=tmp_file.name,
                  key=object_key,
                  bucket_name=self.s3_bucket,
                  replace=self.replace,
              )
  
file_path: airflow/airflow/providers/amazon/aws/transfers/sql_to_s3.py
imports: from __future__ import annotations
  import enum
  from collections import namedtuple
  from tempfile import NamedTemporaryFile
  from typing import TYPE_CHECKING, Any, Iterable, Mapping, Sequence, cast
  from typing_extensions import Literal
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.models import BaseOperator
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
label_desc: Use image node_id 3 for calling the SqlToS3Operator obj's underlying member method code with example usage: obj.execute(context) without return types