You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a progress callback to GoogleDriveFile.Upload() #54
Are you planning to add a callback to show the upload progress?
Progress is a very important feature as I plan to upload a zip close to 750GB of single file
Indeed, it would be great to have an explicit callback argument to handle that, but we don't currently have plans to introduce it ourselves. That being said, we would be happy to accept/help out if anyone is willing to contribute such a feature.
Reacted by Kengo Sawatsu, Ivan Shcheklein and WATANABE Aoi
Indeed, it would be great to have an explicit callback argument to handle that, but we don't currently have plans to introduce it ourselves. That being said, we would be happy to accept/help out if anyone is willing to contribute such a feature.
So if I understand correctly, what's happening here is that you're tracking what parts of the file have been read by PyDrive?
Yes, the wrapper counts bytes read from the local stream. That is useful progress feedback, but it cannot tell you how many bytes Drive has acknowledged, and a retry can read the same bytes again.
With the filesystem interface, put_file already accepts an fsspec callback in 1.21.3 and on main. For example, with an authenticated filesystem mounted at folder_id:
Activity
[-]Hope for additional features: Upload progress callback[/-][+]upload: add callback[/+]efiop commentedon Sep 15, 2020
Hi @KengoSawa2 !
Take a look at https://github.com/iterative/dvc/blob/5e69e29b2f0e3df9b9eab5d682988fd01121b015/dvc/tree/gdrive.py#L362 , where we wrap the fobj we are uploading into a tqdm progress bar.
Indeed, it would be great to have an explicit
callbackargument to handle that, but we don't currently have plans to introduce it ourselves. That being said, we would be happy to accept/help out if anyone is willing to contribute such a feature.TheManchineel commentedon Jun 16, 2022
So if I understand correctly, what's happening here is that you're tracking what parts of the file have been read by PyDrive?
[-]upload: add callback[/-][+]Add a progress callback to GoogleDriveFile.Upload()[/+]shcheklein commentedon Nov 28, 2026
Yes, the wrapper counts bytes read from the local stream. That is useful progress feedback, but it cannot tell you how many bytes Drive has acknowledged, and a retry can read the same bytes again.
With the filesystem interface,
put_filealready accepts an fsspec callback in 1.21.3 and onmain. For example, with an authenticated filesystem mounted atfolder_id:Keeping this open for a progress callback on
GoogleDriveFile.Upload()itself. Filesystem upload implementation