GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — _PropertyMixin.patch() does not work as expected in a batch · Issue #736 · googleapis/google-cloud-python Closed DescriptionOne big takeaway is that If the >>> from gcloud import storage >>> from gcloud.storage.batch import Batch >>> storage._PROJECT_ENV_VAR_NAME = 'GCLOUD_TESTS_PROJECT_ID' >>> storage.set_defaults() >>> bucket_name = 'dsmlmsldfsacjnajdnkewee' >>> connection = storage.get_default_connection() >>> bucket = storage.Bucket(name=bucket_name, connection=connection) >>> blob = storage.Blob('foo', bucket=bucket) >>> blob._reload_properties() <Blob: dsmlmsldfsacjnajdnkewee, foo> >>> blob.content_type = 'foo/bar' >>> >>> with Batch() as batch: ... blob.patch() ... <Blob: dsmlmsldfsacjnajdnkewee, foo> Traceback (most recent call last): File "<stdin>", line 2, in <module> File "gcloud/storage/batch.py", line 165, in __exit__ self.finish() File "gcloud/storage/batch.py", line 130, in finish raise ValueError("No deferred requests") ValueError: No deferred requests On the other hand, if we do the setup correctly, it puts the >>> from gcloud import storage >>> from gcloud.storage.batch import Batch >>> storage._PROJECT_ENV_VAR_NAME = 'GCLOUD_TESTS_PROJECT_ID' >>> storage.set_defaults() >>> >>> with Batch() as batch: ... bucket_name = 'dsmlmsldfsacjnajdnkewee' ... bucket = storage.Bucket(name=bucket_name, connection=batch) ... blob = storage.Blob('foo', bucket=bucket) ... blob.content_type = 'foo/bar' ... blob.patch() ... <Blob: dsmlmsldfsacjnajdnkewee, foo> >>> blob._properties '' >>> blob.content_type Traceback (most recent call last): File "<stdin>", line 1, in <module> File "gcloud/storage/_helpers.py", line 163, in _getter return self.properties[fieldname] File "gcloud/storage/_helpers.py", line 64, in properties return self._properties.copy() AttributeError: 'str' object has no attribute 'copy' Activity
MetadataMetadataAssigneesLabelsapi: storageIssues related to the Cloud Storage API. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |