turbaszek commented on a change in pull request #14191:
URL: https://github.com/apache/airflow/pull/14191#discussion_r575499599
##########
File path: airflow/providers/google/suite/hooks/drive.py
##########
@@ -218,3 +218,15 @@ def upload_file(self, local_location: str,
remote_location: str) -> str:
)
self.log.info("File %s uploaded to gdrive://%s.", local_location,
remote_location)
return file.get("id")
+
+ def download_file(self, file_id: str, file_handle):
+ """
+ Download a file from Google Drive.
+
+ :param file_id: the id of the file
+ :type file_id: str
+ :param file_handle: file handle used to write the content to
+ :type file_handle: io.TextIOWrapper
+ """
+ request = self.get_media_request(file_id=file_id)
+ self.download_content_from_request(file_handle=file_handle,
request=request, chunk_size=104857600)
Review comment:
Should we make the `chunk_size` configurable?
----------------------------------------------------------------
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:
[email protected]