PyDrive2 icon indicating copy to clipboard operation
PyDrive2 copied to clipboard

upload: add callback

Open KengoSawa2 opened this issue 5 years ago • 2 comments

Hello

Thank you for development and contributions of PyDrive2:)

I want to upload a huge zip file by PyDrive2. When I looked into the API, GetContents() has a callback for progress. But UpLoad() does not.

https://gsuitedevs.github.io/PyDrive/docs/build/html/pydrive.html#pydrive.files.GoogleDriveFile.Upload

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

Related: https://github.com/iterative/PyDrive2/issues/49#issuecomment-686286458

KengoSawa2 avatar Sep 06 '20 06:09 KengoSawa2

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

efiop avatar Sep 15 '20 08:09 efiop

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

TheManchineel avatar Jun 16 '22 23:06 TheManchineel