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
For example you can't delete multiple blobs in a batch like you can with the actual the Google service. Test case below.
import tempfile
from google.auth.credentials import AnonymousCredentials
from google.cloud import storage, exceptions
client = storage.Client(
credentials=AnonymousCredentials(),
project="test",
)
bucket = client.get_bucket("test-bucket")
blob = bucket.blob("key1")
blob.upload_from_string("test1")
blob = bucket.blob("key2")
blob.upload_from_string("test2")
try:
with client.batch():
bucket.delete_blob("key1")
bucket.delete_blob("key2")
except exceptions.NotFound:
pass
# List the Buckets
for bucket in client.list_buckets():
print(f"Bucket: {bucket.name}\n")
# List the Blobs in each Bucket
for blob in bucket.list_blobs():
print(f"Blob: {blob.name}")
# Print the content of the Blob
b = bucket.get_blob(blob.name)
with tempfile.NamedTemporaryFile() as temp_file:
s = b.download_to_filename(temp_file.name)
temp_file.seek(0, 0)
print(temp_file.read(), "\n")
For example you can't delete multiple blobs in a batch like you can with the actual the Google service. Test case below.
Output:
The expected result is an empty bucket.
The text was updated successfully, but these errors were encountered: