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","(",")","``","."]
docstr: Mutate DataFrame to set dtypes for float columns containing NaN values.
  
  Set dtype of object to str to allow for downstream transformations.
docstr_tok: ["Mutate","DataFrame","to","set","dtypes","for","float","columns","containing","NaN","values",".","Set","dtype","of","object","to","str","to","allow","for","downstream","transformations","."]
code: def _fix_dtypes(df: pd.DataFrame, file_format: FILE_FORMAT) -> None:
      """
      Mutate DataFrame to set dtypes for float columns containing NaN values.
  
      Set dtype of object to str to allow for downstream transformations.
      """
      try:
          import numpy as np
          import pandas as pd
      except ImportError as e:
          from airflow.exceptions import (
              AirflowOptionalProviderFeatureException,
          )
  
          raise AirflowOptionalProviderFeatureException(e)
  
      for col in df:
          if (
              df[col].dtype.name == "object"
              and file_format == "parquet"
          ):
              # if the type wasn't identified or converted, change it to a string so if can still be
              # processed.
              df[col] = df[col].astype(str)
  
          if "float" in df[col].dtype.name and df[col].hasnans:
              # inspect values to determine if dtype of non-null values is int or float
              notna_series: Any = df[col].dropna().values
              if np.equal(notna_series, notna_series.astype(int)).all():
                  # set to dtype that retains integers and supports NaNs
                  # The type ignore can be removed here if https://github.com/numpy/numpy/pull/23690
                  # is merged and released as currently NumPy does not consider None as valid for x/y.
                  df[col] = np.where(df[col].isnull(), None, df[col])  # type: ignore[call-overload]
                  df[col] = df[col].astype(pd.Int64Dtype())
              elif np.isclose(
                  notna_series, notna_series.astype(int)
              ).all():
                  # set to float dtype that retains floats and supports NaNs
                  # The type ignore can be removed here if https://github.com/numpy/numpy/pull/23690
                  # is merged and released
                  df[col] = np.where(df[col].isnull(), None, df[col])  # type: ignore[call-overload]
                  df[col] = df[col].astype(pd.Float64Dtype())
  
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 2 for calling the SqlToS3Operator obj's underlying member method code with example usage: obj._fix_dtypes(df, file_format) without return types