FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add '{Bucket,Blob}.user_project' properties. by tseaver · Pull Request #3490 · googleapis/google-cloud-python · GitHub

Add '{Bucket,Blob}.user_project' properties. - #3490

Merged
tseaver merged 9 commits into
googleapis:masterfrom
tseaver:3474-storage-bucket-requester_pays-user_project-property
Jun 13, 2017
Merged

Add '{Bucket,Blob}.user_project' properties.#3490
tseaver merged 9 commits into
googleapis:masterfrom
tseaver:3474-storage-bucket-requester_pays-user_project-property

Conversation

tseaver commented Jun 8, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Uses #3489 as a base.

tseaver added api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 8, 2017
tseaver requested review from dhermes and lukesneeringer June 8, 2017 20:16
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 8, 2017

tseaver commented Jun 9, 2017

Copy link
Copy Markdown
Contributor Author

Rebased against master after the merge of #3488.

dhermes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pretty straightforward, mostly (totally?) just nits

# Pass only '?projection=noAcl' here because 'acl' and related
# are handled via custom endpoints.
query_params = {'projection': 'noAcl'}
if self.user_project is not None:

This comment was marked as spam.

This comment was marked as spam.

@property
def user_project(self):
"""Project ID used for API requests made via this blob.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread storage/google/cloud/storage/bucket.py Outdated

:type user_project: str
:param user_project: (Optional) the project ID to be billed for API
requests made via this instance.

This comment was marked as spam.

This comment was marked as spam.

def user_project(self):
"""Project ID to be billed for API requests made via this bucket.

If unset, API requests are billed to the bucket owner.

This comment was marked as spam.

This comment was marked as spam.

mixin = self._make_one()
self.assertRaises(NotImplementedError, lambda: mixin.path)
with self.assertRaises(NotImplementedError):
mixin.path

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread storage/tests/unit/test__helpers.py Outdated
connection = _Connection({'foo': 'Foo'})
client = _Client(connection)
derived = self._derivedClass('/path', user_project)()
# Make sure changes is not a set, so we can observe a change.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread storage/tests/unit/test__helpers.py Outdated
self.assertEqual(kw[0]['path'], '/path')
self.assertEqual(
kw[0]['query_params'],
{'projection': 'noAcl', 'userProject': user_project})

This comment was marked as spam.

This comment was marked as spam.

bucket = klass(client, name=NAME, user_project=USER_PROJECT)
self.assertEqual(bucket.name, NAME)
self.assertEqual(bucket._properties, {})
self.assertEqual(bucket.user_project, USER_PROJECT)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread storage/tests/unit/test__helpers.py Outdated
kw[0]['query_params'],
{'projection': 'full', 'userProject': user_project})
# Since changes does not include `baz`, we don't see it sent.
self.assertEqual(kw[0]['data'], {'bar': BAR})

This comment was marked as spam.

This comment was marked as spam.

dhermes commented Jun 12, 2017

Copy link
Copy Markdown
Contributor

LGTM after your comment update

tseaver merged commit 60832b8 into googleapis:master Jun 13, 2017
tseaver deleted the 3474-storage-bucket-requester_pays-user_project-property branch June 13, 2017 13:55
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 21, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
tseaver added a commit that referenced this pull request Sep 22, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
tseaver added a commit that referenced this pull request Oct 2, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
tseaver added a commit that referenced this pull request Oct 5, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
tseaver added a commit that referenced this pull request Oct 10, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
tseaver added a commit that referenced this pull request Oct 10, 2017
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
parthea pushed a commit that referenced this pull request Mar 9, 2026
* Add abstract '_PropertyMixin.user_project' property.

* Support 'user_project' in '_PropertyMixin.{reload,patch}'.

* Add 'user_project' param to 'Bucket.__init__'.

* Save and expose via read-only 'user_project' property.

* Implement 'Blob.user_property' via bucket's value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL