Skip to content

Commit

Permalink
Change the default chunk_size to a clear representation & add docum…
Browse files Browse the repository at this point in the history
…entation (#22222)
  • Loading branch information
ulsc committed Mar 13, 2022
1 parent af9d85c commit c108f26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/providers/google/suite/hooks/drive.py
Expand Up @@ -219,12 +219,13 @@ def upload_file(
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: IO, chunk_size: int = 104857600):
def download_file(self, file_id: str, file_handle: IO, chunk_size: int = 100 * 1024 * 1024):
"""
Download a file from Google Drive.
:param file_id: the id of the file
:param file_handle: file handle used to write the content to
:param chunk_size: File will be downloaded in chunks of this many bytes.
"""
request = self.get_media_request(file_id=file_id)
self.download_content_from_request(file_handle=file_handle, request=request, chunk_size=chunk_size)

0 comments on commit c108f26

Please sign in to comment.