You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vincbeck (via GitHub)" <gi...@apache.org> on 2023/04/06 17:32:00 UTC

[GitHub] [airflow] vincbeck commented on a diff in pull request #30460: SqlToS3Operator - Add feature to partition SQL table

vincbeck commented on code in PR #30460:
URL: https://github.com/apache/airflow/pull/30460#discussion_r1160078155


##########
airflow/providers/amazon/aws/transfers/sql_to_s3.py:
##########
@@ -170,15 +172,26 @@ def execute(self, context: Context) -> None:
         self._fix_dtypes(data_df, self.file_format)
         file_options = FILE_OPTIONS_MAP[self.file_format]
 
-        with NamedTemporaryFile(mode=file_options.mode, suffix=file_options.suffix) as tmp_file:
-
-            self.log.info("Writing data to temp file")
-            getattr(data_df, file_options.function)(tmp_file.name, **self.pd_kwargs)
-
-            self.log.info("Uploading data to S3")
-            s3_conn.load_file(
-                filename=tmp_file.name, key=self.s3_key, bucket_name=self.s3_bucket, replace=self.replace
-            )
+        for group_name, df in self._partition_dataframe(df=data_df):

Review Comment:
   `df` is not used here. Intentional?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org