Skip to content

Bucket.delete_blobs drops 'generation' #814

@jimdigriz

Description

@jimdigriz

Whilst iterating the list, generation is dropped in the call to Bucket.delete_blob() (if Blob is passed in it should be a passthrough) resulting in much gnashing of teeth...

for blob in blobs:
try:
blob_name = blob
if not isinstance(blob_name, str):
blob_name = blob.name
self.delete_blob(
blob_name,
client=client,
if_generation_match=next(if_generation_match, None),
if_generation_not_match=next(if_generation_not_match, None),
if_metageneration_match=next(if_metageneration_match, None),
if_metageneration_not_match=next(if_metageneration_not_match, None),
timeout=timeout,
retry=retry,
)
except NotFound:
if on_error is not None:
on_error(blob)
else:
raise

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions