Skip to content

Storage: bucket.labels surprisingly returns a deepcopy #3710

Closed
@theacodes

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(bucket_name)
    labels = bucket.labels
    labels['example'] = 'label'
    bucket.labels = labels
    bucket.patch()

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions