-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[storage] fix: use unique blob name #3568
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
Conversation
blob = Blob( | ||
blob_name, | ||
bucket, | ||
encryption_key=TEST_ENCRYPTION_KEY_2_DECODED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised you need to pass in the encryption key to delete the object. Could you provide context on how you arrived to this solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that is something that already exists in the sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused, because the encryption_key isn't required to delete in the second call and only needed in the instantiation. At least If I'm understanding correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. I just got NotFound
and realized you need the key to delete the blob.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the try-except, it is always fail with the following error:
google.api_core.exceptions.NotFound: 404 DELETE https://storage.googleapis.com/storage/v1/b/tmatsuo-test-bucket/o/test_blob_7188d5dc44764ef7a6bc19a815385daf?generation=1588127655320921: No such object: tmatsuo-test-bucket/test_blob_7188d5dc44764ef7a6bc19a815385daf
blob = Blob( | ||
blob_name, | ||
bucket, | ||
encryption_key=TEST_ENCRYPTION_KEY_2_DECODED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused, because the encryption_key isn't required to delete in the second call and only needed in the instantiation. At least If I'm understanding correctly.
fixes #3567