Skip to content

Commit c1c87bd

Browse files
Takashi Matsuoplamut
Takashi Matsuo
authored andcommitted
[bigquery] opt in to use the build specific projects [(#3883)](GoogleCloudPlatform/python-docs-samples#3883)
fixes #3882
1 parent 0e31768 commit c1c87bd

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

samples/snippets/README.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ This directory contains samples for Google BigQuery. `Google BigQuery`_ is Googl
1414

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

17+
18+
To run the sample, you need to have `BigQuery Admin` role.
19+
20+
21+
1722
Setup
1823
-------------------------------------------------------------------------------
1924

@@ -108,7 +113,7 @@ To run this sample:
108113
109114
$ python user_credentials.py
110115
111-
usage: user_credentials.py [-h] [--launch-browser] project query
116+
usage: user_credentials.py [-h] [--launch-browser] project
112117
113118
Command-line application to run a query using user credentials.
114119
@@ -117,7 +122,6 @@ To run this sample:
117122
118123
positional arguments:
119124
project Project to use for BigQuery billing.
120-
query BigQuery SQL Query.
121125
122126
optional arguments:
123127
-h, --help show this help message and exit

samples/snippets/README.rst.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ product:
1111
analyzing data to find meaningful insights, use familiar SQL, and take
1212
advantage of our pay-as-you-go model.
1313

14+
required_role: BigQuery Admin
15+
1416
setup:
1517
- auth
1618
- install_deps
@@ -26,4 +28,4 @@ samples:
2628

2729
cloud_client_library: true
2830

29-
folder: bigquery/cloud-client
31+
folder: bigquery/cloud-client

samples/snippets/noxfile_config.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Default TEST_CONFIG_OVERRIDE for python repos.
16+
17+
# You can copy this file into your directory, then it will be inported from
18+
# the noxfile.py.
19+
20+
# The source of truth:
21+
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py
22+
23+
TEST_CONFIG_OVERRIDE = {
24+
# You can opt out from the test for specific Python versions.
25+
'ignored_versions': ["2.7"],
26+
27+
# An envvar key for determining the project id to use. Change it
28+
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
29+
# build specific Cloud project. You can also use your own string
30+
# to use your own Cloud project.
31+
# 'gcloud_project_env': 'GCLOUD_PROJECT',
32+
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
33+
34+
# A dictionary you want to inject into your test. Don't put any
35+
# secrets here. These values will override predefined values.
36+
'envs': {},
37+
}

0 commit comments

Comments
 (0)