GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add '{Bucket,Blob}.user_project' properties. by tseaver · Pull Request #3490 · googleapis/google-cloud-python

Conversation

@tseaver

@tseaver tseaver commented Jun 8, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Uses #3489 as a base.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver 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
tseaver requested review from dhermes and lukesneeringer June 8, 2017 20:16
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 8, 2017
This was referenced Jun 8, 2017
Add support for "requester pays" operations #3474
Closed
Support 'user_project' in '_PropertyMixin.{reload,patch}'. #3489
Closed
Add 'Bucket.requester_pays' property. #3488
Merged
tseaver added 4 commits June 9, 2017 15:37
@tseaver
Add abstract '_PropertyMixin.user_project' property.
2edd4c3
@tseaver
Add 'user_project' param to 'Bucket.__init__'.
cb0f3c9
Save and expose via read-only 'user_project' property.
@tseaver
Implement 'Blob.user_property' via bucket's value.
e57f21c
@tseaver
Support 'user_project' in '_PropertyMixin.{reload,patch}'.
056b0cd
@tseaver

tseaver commented Jun 9, 2017

Copy link
Copy Markdown
Contributor Author

Rebased against master after the merge of #3488.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver mentioned this pull request Jun 9, 2017
Pass 'user_project' if set for Bucket API requests #3492
Merged
dhermes
dhermes reviewed Jun 12, 2017
View reviewed changes

@dhermes dhermes left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pretty straightforward, mostly (totally?) just nits

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread storage/google/cloud/storage/_helpers.py
# 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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storage/google/cloud/storage/blob.py
@property
def user_project(self):
"""Project ID used for API requests made via this blob.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storage/google/cloud/storage/bucket.py
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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storage/tests/unit/test__helpers.py
mixin = self._make_one()
self.assertRaises(NotImplementedError, lambda: mixin.path)
with self.assertRaises(NotImplementedError):
mixin.path

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storage/tests/unit/test_bucket.py
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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver added 3 commits June 12, 2017 16:10
@tseaver
Docstring tweaks.
c2ac0b9
Addresses:
#3490 (comment)
#3490 (comment)
#3490 (comment).
@tseaver
Assert whole requested dict.
fec9e7c
Addresses:
#3490 (comment)
#3490 (comment)
@tseaver
Assert 'Bucket.user_project' is None if not passed explicitly.
4d035d7
Addresses:
https://github.com/GoogleCloudPlatform/google-cloud-python/pull/3490/files#r121504793
@dhermes

dhermes commented Jun 12, 2017

Copy link
Copy Markdown
Contributor

LGTM after your comment update

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver added 2 commits June 12, 2017 18:17
@tseaver
Add an explicit test for the 'user_project' property.
28fff05
Addresses:
#3490 (comment)
@tseaver
Clarify that 'reload' resets the non-set '_changes'.
5817600
Addresses:
#3490 (comment)
@tseaver
tseaver merged commit 60832b8 into googleapis:master Jun 13, 2017
@tseaver
tseaver deleted the 3474-storage-bucket-requester_pays-user_project-property branch June 13, 2017 13:55
@mbookman mbookman mentioned this pull request Aug 16, 2017
Support for additional parameters to loadTrack igvteam/igv.js#393
Closed
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 21, 2017
@tseaver @landrito
Add '{Bucket,Blob}.user_project' properties. (googleapis#3490)
637c3f4
* 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
@tseaver @landrito
Add '{Bucket,Blob}.user_project' properties. (googleapis#3490)
e80c95c
* 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
@tseaver @landrito
Add '{Bucket,Blob}.user_project' properties. (googleapis#3490)
292f513
* 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
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
9ec0fe9
* 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
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
17d0cbf
* 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
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
28fe838
* 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
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
5ccefa4
* 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
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
8339999
* 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.
vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
Takashi Matsuo @busunkim96
[dialogflow] fix: marking a test with flaky [(#3671)](GoogleCloudPlat…
cdb17b6
…form/python-docs-samples#3671)

fixes #3490
parthea pushed a commit that referenced this pull request Mar 9, 2026
@tseaver
Add '{Bucket,Blob}.user_project' properties. (#3490)
2414218
* 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.
@chalmerlowe chalmerlowe mentioned this pull request Sep 11, 2026
feat(core): add request hook to enrich T4 network spans with GCP resource attributes (E) #18272
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lukesneeringer lukesneeringer Awaiting requested review from lukesneeringer
1 more reviewer
@dhermes dhermes dhermes left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@tseaver @dhermes @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.