def execute(self, context) -> None:
    mysql_hook = MySqlHook(mysql_conn_id=self.mysql_conn_id)
    s3_conn = S3Hook(aws_conn_id=self.aws_conn_id, verify=self.verify)
    data_df = mysql_hook.get_pandas_df(self.query)
    self.log.info('Data from MySQL obtained')
    self._fix_int_dtypes(data_df)
    with NamedTemporaryFile(mode='r+', suffix='.csv') as tmp_csv:
        data_df.to_csv(tmp_csv.name, **self.pd_csv_kwargs)
        s3_conn.load_file(filename=tmp_csv.name, key=self.s3_key, bucket_name=self.s3_bucket)
    if s3_conn.check_for_key(self.s3_key, bucket_name=self.s3_bucket):
        file_location = os.path.join(self.s3_bucket, self.s3_key)
        self.log.info('File saved correctly in %s', file_location)
def execute(self, context) -> None:
    mysql_hook = MySqlHook(mysql_conn_id=self.mysql_conn_id)
    s3_conn = S3Hook(aws_conn_id=self.aws_conn_id, verify=self.verify)
    data_df = mysql_hook.get_pandas_df(self.query)
    self.log.info('Data from MySQL obtained')
    self._fix_int_dtypes(data_df)
    with NamedTemporaryFile(mode='r+', suffix='.csv') as tmp_csv:
        data_df.to_csv(tmp_csv.name, **self.pd_csv_kwargs)
        s3_conn.load_file(filename=tmp_csv.name, key=self.s3_key, bucket_name=self.s3_bucket)
    if s3_conn.check_for_key(self.s3_key, bucket_name=self.s3_bucket):
        file_location = os.path.join(self.s3_bucket, self.s3_key)
        self.log.info('File saved correctly in %s', file_location)