Title: Storage: bucket.labels surprisingly returns a deepcopy · Issue #3710 · googleapis/google-cloud-python · GitHub
Open Graph Title: Storage: bucket.labels surprisingly returns a deepcopy · Issue #3710 · googleapis/google-cloud-python
X Title: Storage: bucket.labels surprisingly returns a deepcopy · Issue #3710 · googleapis/google-cloud-python
Description: I expected this to work: bucket = storage_client.get_bucket(bucket_name) bucket.labels['example'] = 'label' bucket.patch() Turns out bucket.labels returns a deepcopy, so I have to do this instead: bucket = storage_client.get_bucket(bucke...
Open Graph Description: I expected this to work: bucket = storage_client.get_bucket(bucket_name) bucket.labels['example'] = 'label' bucket.patch() Turns out bucket.labels returns a deepcopy, so I have to do this instead: ...
X Description: I expected this to work: bucket = storage_client.get_bucket(bucket_name) bucket.labels['example'] = 'label' bucket.patch() Turns out bucket.labels returns a deepcopy, so I have to d...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/3710
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Storage: bucket.labels surprisingly returns a deepcopy","articleBody":"I expected this to work:\r\n\r\n```python\r\n bucket = storage_client.get_bucket(bucket_name)\r\n bucket.labels['example'] = 'label'\r\n bucket.patch()\r\n```\r\n\r\nTurns out `bucket.labels` returns a deepcopy, so I have to do this instead:\r\n\r\n```python\r\n bucket = storage_client.get_bucket(bucket_name)\r\n labels = bucket.labels\r\n labels['example'] = 'label'\r\n bucket.labels = labels\r\n bucket.patch()\r\n```","author":{"url":"https://github.com/theacodes","@type":"Person","name":"theacodes"},"datePublished":"2017-08-01T17:56:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/3710/google-cloud-python/issues/3710"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb595000-001a-dbff-48d3-ffd642c814e0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D488:B4B51:150A1EB:1C7C6E1:6A4D74BB |
| html-safe-nonce | 56befefbf5cacd4c023aab1ec52d4cad1cc153e9a5e5b0e4caffecf5d4f9962e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDg4OkI0QjUxOjE1MEExRUI6MUM3QzZFMTo2QTRENzRCQiIsInZpc2l0b3JfaWQiOiI0NjM5OTAzMDMxOTI3NjAwMzE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 804df195ffbb132b7cd1a6f54d238fcd408c484792420766ff15575f61ca6072 |
| hovercard-subject-tag | issue:247151102 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/3710/issue_layout |
| twitter:image | https://opengraph.githubassets.com/034a027a2fe7adae84d0d9fe0b63d6aa7ea41ebb5c08f66ad316596c40316cd3/googleapis/google-cloud-python/issues/3710 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/034a027a2fe7adae84d0d9fe0b63d6aa7ea41ebb5c08f66ad316596c40316cd3/googleapis/google-cloud-python/issues/3710 |
| og:image:alt | I expected this to work: bucket = storage_client.get_bucket(bucket_name) bucket.labels['example'] = 'label' bucket.patch() Turns out bucket.labels returns a deepcopy, so I have to do this instead: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theacodes |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width