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

feat: enable delete_blobs() to preserve generation - #840

Merged
gcf-merge-on-green[bot] merged 8 commits into
googleapis:mainfrom
cojenco:814-del-blobs
Aug 23, 2022
Merged

feat: enable delete_blobs() to preserve generation#840
gcf-merge-on-green[bot] merged 8 commits into
googleapis:mainfrom
cojenco:814-del-blobs

Conversation

@cojenco

@cojencocojenco commented Aug 10, 2022

Copy link
Copy Markdown
Contributor

This adds a flag preserve_generation to the method bucket.delete_blobs()

  • allows preserving and propagating blob generations when set to True (default False)
  • better ensures backwards compatibility with both delete_blobs() and bucket.delete(force=True)

Fixes#814

@product-auto-labelproduct-auto-labelBot added size: s Pull request size is small. api: storage Issues related to the googleapis/python-storage API. labels Aug 10, 2022
@andrewsg

Copy link
Copy Markdown
Contributor

Looks good, but can we additionally update the docstring to mention that the default behavior is to drop the generation? That way preserve_generation makes sense in context.

@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Aug 11, 2022
@cojenco
cojenco marked this pull request as ready for review August 11, 2022 22:57
@cojenco
cojenco requested review from a teamAugust 11, 2022 22:57
@cojenco

Copy link
Copy Markdown
ContributorAuthor

Looks good, but can we additionally update the docstring to mention that the default behavior is to drop the generation? That way preserve_generation makes sense in context.

Great idea, I've noted the default behavior in the docstring

Comment threadgoogle/cloud/storage/bucket.py Outdated
Comment threadgoogle/cloud/storage/bucket.py Outdated
Comment threadgoogle/cloud/storage/bucket.py Outdated
@cojenco
cojenco requested a review from andrewsgAugust 15, 2022 22:57
@cojencocojenco added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2022
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2022
@cojencocojenco added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 23, 2022
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 23, 2022
@cojencocojenco added the automerge Merge the pull request once unit tests and other checks pass. label Aug 23, 2022
@gcf-merge-on-green
gcf-merge-on-greenBot merged commit 8fd4c37 into googleapis:mainAug 23, 2022
@gcf-merge-on-greengcf-merge-on-greenBot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 23, 2022
@release-pleaserelease-pleaseBot mentioned this pull request Aug 23, 2022
@cojenco
cojenco deleted the 814-del-blobs branch February 1, 2023 22:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storageIssues related to the googleapis/python-storage API.size: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bucket.delete_blobs drops 'generation'

4 participants

@cojenco@andrewsg@yoshi-kokoro@parthea