Skip to content

[bigquery] opt in to use the build specific projects #3883

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
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bigquery/cloud-client/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ This directory contains samples for Google BigQuery. `Google BigQuery`_ is Googl

.. _Google BigQuery: https://cloud.google.com/bigquery/docs


To run the sample, you need to have `BigQuery Admin` role.



Setup
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -108,7 +113,7 @@ To run this sample:

$ python user_credentials.py

usage: user_credentials.py [-h] [--launch-browser] project query
usage: user_credentials.py [-h] [--launch-browser] project

Command-line application to run a query using user credentials.

Expand All @@ -117,7 +122,6 @@ To run this sample:

positional arguments:
project Project to use for BigQuery billing.
query BigQuery SQL Query.

optional arguments:
-h, --help show this help message and exit
Expand Down
4 changes: 3 additions & 1 deletion bigquery/cloud-client/README.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ product:
analyzing data to find meaningful insights, use familiar SQL, and take
advantage of our pay-as-you-go model.

required_role: BigQuery Admin

setup:
- auth
- install_deps
Expand All @@ -26,4 +28,4 @@ samples:

cloud_client_library: true

folder: bigquery/cloud-client
folder: bigquery/cloud-client
37 changes: 37 additions & 0 deletions bigquery/cloud-client/noxfile_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default TEST_CONFIG_OVERRIDE for python repos.

# You can copy this file into your directory, then it will be inported from
# the noxfile.py.

# The source of truth:
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
'ignored_versions': ["2.7"],

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
# 'gcloud_project_env': 'GCLOUD_PROJECT',
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',

# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
'envs': {},
}