OS: Debian Stretch
Python 3.6.6
google-cloud-storage 1.10.0
In the following scenario, the API will return versioned blobs. However, it is unable to delete a specific version, as the Blob.delete method does not take a generation parameter nor does Bucket.delete_blob.
from google.cloud.storage import Client
client = Client(project='project-name')
bucket = client.get_bucket('foobar')
blobs = bucket.list_blobs(versions=True)
blobs will iterate over all versions, but calling .delete() on any of them will always delete the current version as the delete code does not supply ?generation=<generation> in the request.
This leads to unintentional data loss when trusting blob.delete() to delete that specific blob.
Ideally, blob.delete() would delete the generation corresponding to that blob's .generation property (this would mimic boto's behavior).
OS: Debian Stretch
Python 3.6.6
google-cloud-storage 1.10.0
In the following scenario, the API will return versioned blobs. However, it is unable to delete a specific version, as the
Blob.deletemethod does not take agenerationparameter nor doesBucket.delete_blob.blobswill iterate over all versions, but calling.delete()on any of them will always delete the current version as the delete code does not supply?generation=<generation>in the request.This leads to unintentional data loss when trusting
blob.delete()to delete that specific blob.Ideally,
blob.delete()would delete the generation corresponding to that blob's.generationproperty (this would mimicboto's behavior).