Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket.delete_blobs drops 'generation' #814

Closed
jimdigriz opened this issue Jun 10, 2022 · 0 comments · Fixed by #840 or #838
Closed

Bucket.delete_blobs drops 'generation' #814

jimdigriz opened this issue Jun 10, 2022 · 0 comments · Fixed by #840 or #838
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jimdigriz
Copy link

jimdigriz commented Jun 10, 2022

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

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Jun 10, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 11, 2022
@danielbankhead danielbankhead added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Jun 13, 2022
@cojenco cojenco self-assigned this Jun 14, 2022
@cojenco cojenco added the status: investigating The issue is under investigation, which is determined to be non-trivial. label Jun 14, 2022
@cojenco cojenco removed the status: investigating The issue is under investigation, which is determined to be non-trivial. label Jun 15, 2022
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jun 15, 2022
@cojenco cojenco added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
4 participants