Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit 4f618b2

Browse files
committed
Force delete buckets
1 parent cc41714 commit 4f618b2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

samples/snippets/export_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def _create_sink_name():
5050

5151

5252
@backoff.on_exception(backoff.expo, Exception, max_time=60, raise_on_giveup=False)
53-
def _delete_object(obj, force=False):
54-
obj.delete()
53+
def _delete_object(obj, **kwargs):
54+
obj.delete(**kwargs)
5555

5656

5757
# Runs once for entire test suite
@@ -79,9 +79,7 @@ def cleanup_old_sinks():
7979
# Bucket timestamp is int(time.time() * 1000)
8080
bucket_timestamp = int(match.group(1))
8181
if TIMESTAMP - bucket_timestamp // 1000 > CLEANUP_THRESHOLD:
82-
# Delete all blobs in the bucket before deleting the bucket.
83-
bucket.delete_blobs(bucket.list_blobs())
84-
_delete_object(bucket)
82+
_delete_object(bucket, force=True)
8583

8684

8785
@pytest.fixture

0 commit comments

Comments
 (0)