Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: add cloud client samples from python-docs-samples #626

Merged
merged 201 commits into from
Oct 19, 2021
Merged

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented Oct 18, 2021

Pull samples in from https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/storage/cloud-client

  • Add noxfile.py
  • Remove invalid/unused region tag in notification_polling.py
    ( The github code demo is directly linked here. The region tags are invalid and are not registered code samples.)
  • TODO in a separate PR Update snippets README #627

Jon Wayne Parrott and others added 30 commits July 13, 2016 10:15
Change-Id: Ieaf7237fc6f925daec46a07d2e81a452b841198a
Change-Id: Ib44f9bb42bf0c0607e64905a26369f06ea5fb231
Change-Id: I94973a839f38ef3d1ec657c3c79f666eca56728b
Change-Id: Ie9cf585303931f200a763d691906ad56221105fd
* Add tests for quickstarts
* Update secrets
* Remove cloud config fixture

* Fix client secrets

* Fix bigtable instance
* Auto-update dependencies.

* xfail the error reporting test

* Fix lint
* Add bucket-level IAM samples
* Address review comments
* Fix README rst links

* Update all READMEs
* Auto-update dependencies.

* Fix natural language samples

* Fix pubsub iam samples

* Fix language samples

* Fix bigquery samples
* Auto-update dependencies.

* Explicitly use latest bigtable client

Change-Id: Id71e9e768f020730e4ca9514a0d7ebaa794e7d9e

* Revert language update for now

Change-Id: I8867f154e9a5aae00d0047c9caf880e5e8f50c53

* Remove pdb. smh

Change-Id: I5ff905fadc026eebbcd45512d4e76e003e3b2b43
@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Oct 18, 2021
@cojenco cojenco added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Oct 18, 2021
@google-cla
Copy link

google-cla bot commented Oct 18, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Oct 18, 2021
@google-cla
Copy link

google-cla bot commented Oct 18, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 18, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@cojenco cojenco added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 18, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 18, 2021
@cojenco cojenco mentioned this pull request Oct 18, 2021
@cojenco cojenco added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Oct 18, 2021
@cojenco cojenco marked this pull request as ready for review October 18, 2021 22:15
@cojenco cojenco requested review from a team as code owners October 18, 2021 22:15
Copy link
Contributor

@unforced unforced left a comment

Choose a reason for hiding this comment

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

I want to see your graph of total # of lines of code committed after this is approved, haha.

@cojenco cojenco added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 19, 2021
@cojenco cojenco merged commit e08f638 into main Oct 19, 2021
@cojenco cojenco deleted the move-samples branch October 19, 2021 18:45
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

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

I'm sorry I overlooked this PR last week. I only noticed today because of PR #630, which is trying to update the dependency for google-api-python-client.


import backoff
from google.cloud import storage
from googleapiclient.errors import HttpError
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a fossil from samples that used googleapiclient. I'm pretty sure that doing backoff / retries around this error is pointless -- nothing else in google-cloud-storage ever raises it (or imports / depends on googleapiclient).

Copy link
Contributor

Choose a reason for hiding this comment

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

The correct error class is probably google.api_core.exceptions.GoogleAPIError.

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 googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.