You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/17 16:49:20 UTC

[GitHub] [airflow] Scuall1992 commented on a change in pull request #14276: Refactor Gdrive to GCS operator

Scuall1992 commented on a change in pull request #14276:
URL: https://github.com/apache/airflow/pull/14276#discussion_r577773760



##########
File path: airflow/providers/google/cloud/transfers/gdrive_to_gcs.py
##########
@@ -129,4 +104,10 @@ def execute(self, context):
             delegate_to=self.delegate_to,
             impersonation_chain=self.impersonation_chain,
         )
-        self._upload_data(gdrive_hook=gdrive_hook, gcs_hook=gcs_hook)
+        file_metadata = gdrive_hook.get_file_id(
+            folder_id=self.folder_id, file_name=self.file_name, drive_id=self.drive_id
+        )
+        with gcs_hook.provide_file_and_upload(
+            bucket_name=self.bucket_name, object_name=self.object_name
+        ) as file:
+            gdrive_hook.download_file(file_id=file_metadata["id"], file_handle=file)

Review comment:
       Yes, I'll do it today




----------------------------------------------------------------
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.

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