Blob.metadata not preserved when uploading new file content #293
Labels
api: storage
Issues related to the googleapis/python-storage API.
type: question
Request for information or clarification. Not an issue.
blob.metadata
is not preserved when uploading new file content on an existing Blob instance withblob.upload_from_string(...)
unless you first reset it withblob.metadata = blob.metadata
.I suspect this bug / surprising behaviour is the result of the somewhat awkward mapping of the REST API onto mutable objects. It feels like setting metadata should really be a parameter of the blob upload methods instead of a mutable field on the instance.
Environment details
Both locally on my Mac and within Google Cloud Functions
python --version
Python 3.8.5
pip --version
pip 20.1.1
google-cloud-storage
version:pip show google-cloud-storage
google-cloud-storage==1.31.2
Steps to reproduce
See code example.
Code example
The text was updated successfully, but these errors were encountered: