Uh oh!
There was an error while loading. Please reload this page.
Storage: Track deleted labels; make Bucket.patch() send them. - #3737
Conversation
googlebot
commented
Aug 7, 2017
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
lukesneeringer
commented
Aug 7, 2017
Grumble grumble grumble @googlebot. |
tseaver
commented
Aug 7, 2017
#3715 merged, so you can rebase to appease googlebot. |
Turns out some properties (i.e., 'labels', see googleapis#3711) behave differently under 'patch semantics'[1], which makes 'update' useful. [1] https://cloud.google.com/storage/docs/json_api/v1/how-tos/performance#patch
lukesneeringer
commented
Aug 7, 2017
Done, just need a review (and to fix CI). |
| ``client`` stored on the current object. | ||
| """ | ||
| answer = super(Bucket, self).update(client=client) | ||
| self._label_removals.clear() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| _, _, kwargs = client._connection.api_request.mock_calls[0] | ||
| self.assertEqual(len(kwargs['data']['labels']), 2) | ||
| self.assertEqual(kwargs['data']['labels']['color'], 'red') | ||
| self.assertEqual(kwargs['data']['labels']['flavor'], 'cherry') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lukesneeringer
commented
Aug 7, 2017
Thanks for catching that @tseaver. Updates made. |
| # If the values are reset, the changes must as well. | ||
| self._changes = set() | ||
| if hasattr(self, '_label_removals'): | ||
| self._label_removals.clear() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lukesneeringer
commented
Aug 10, 2017
@tseaver@jonparrott Can someone give this a final signoff so I can merge it? :-) |
Uses #3715 as a base.
This PR adds tracking for deleted labels on the
Bucketobject, and causes the appropriate data to be sent whenBucket.patchis called.Fixes#3711.