Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BigQuery - REST samples for adding labels. #764

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

Merged
merged 1 commit into from
Jan 20, 2017
Merged

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Jan 20, 2017

@tswast tswast requested a review from theacodes January 20, 2017 20:21
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 20, 2017
@tswast
Copy link
Contributor Author

tswast commented Jan 20, 2017

I'm looking into the Travis failure.

{\n  "error" : "invalid_scope",\n  "error_description" : "Empty or missing scope not allowed."\n}

Strange that it worked on my machine. I guess maybe because Travis is using a service account and I was using gcloud credentials?

@tswast
Copy link
Contributor Author

tswast commented Jan 20, 2017

I'll add a scope argument to the google.auth.defaults() call.

@theacodes
Copy link
Contributor

I'll add a scope argument to the google.auth.defaults() call.

yep, that should do it.

})

# Check the response for errors.
if response.status_code != 200:
Copy link
Contributor

Choose a reason for hiding this comment

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

use response.raise_for_status().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

project_id = default_project_id

# Send a PATCH request to add or modify a label.
session = google.auth.transport.requests.AuthorizedSession(credentials)
Copy link
Contributor

Choose a reason for hiding this comment

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

put session in the auth section (two lines above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,84 @@
#!/usr/bin/env python
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to combine these into one single file named labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it would. Combined.

@theacodes theacodes merged commit 1822e4e into master Jan 20, 2017
@theacodes theacodes deleted the tswast-bq-labels branch January 20, 2017 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bigquery cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.