PyDrive2
PyDrive2 copied to clipboard
upload: add callback
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
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.
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.
So if I understand correctly, what's happening here is that you're tracking what parts of the file have been read by PyDrive?