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

feat: enable delete_blobs() to preserve generation #840

Merged
merged 8 commits into from
Aug 23, 2022

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented Aug 10, 2022

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-label product-auto-label bot 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
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-label product-auto-label bot 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 team as code owners August 11, 2022 22:57
@cojenco
Copy link
Contributor Author

cojenco commented Aug 11, 2022

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

google/cloud/storage/bucket.py Outdated Show resolved Hide resolved
google/cloud/storage/bucket.py Outdated Show resolved Hide resolved
google/cloud/storage/bucket.py Outdated Show resolved Hide resolved
@cojenco cojenco requested a review from andrewsg August 15, 2022 22:57
@cojenco cojenco added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2022
@cojenco cojenco added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 23, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 23, 2022
@cojenco cojenco 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-green bot merged commit 8fd4c37 into googleapis:main Aug 23, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 23, 2022
@cojenco cojenco deleted the 814-del-blobs branch February 1, 2023 22:35
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. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bucket.delete_blobs drops 'generation'
4 participants