-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.
Description
Environment details
Arch Linux (Docker; tag 20191205; https://hub.docker.com/_/archlinux)
PyPy3 7.2
google-cloud-storage-1.23.0
Steps to reproduce
- Use the
batch()context manager to create a batch of blob deletes - Execute the batch
Code example
def delete_all_by_prefix(self, prefix):
blobs_to_delete = [blob for blob in self._bucket.list_blobs(prefix=prefix)]
if not blobs_to_delete:
return
batch_size = 500
for i in range(0, len(blobs_to_delete), batch_size):
batch = blobs_to_delete[i:(i + batch_size)]
with self._client.batch():
for b in batch:
b.delete()Stack trace
Traceback (most recent call last):
...
File "/opt/pypy3/site-packages/google/cloud/storage/blob.py", line 554, in delete
self.name, client=client, generation=self.generation
File "/opt/pypy3/site-packages/google/cloud/storage/bucket.py", line 1100, in delete_blob
_target_object=None,
File "/opt/pypy3/site-packages/google/cloud/_http.py", line 417, in api_request
timeout=timeout,
File "/opt/pypy3/site-packages/google/cloud/_http.py", line 275, in _make_request
method, url, headers, data, target_object, timeout=timeout
TypeError: _do_request() got an unexpected keyword argument 'timeout'
Other info
I was able to fix the issue by monkey-patching google.cloud.storage.batch.Batch._do_request.
william-silversmith
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.