Skip to content

Commit 7c19fb2

Browse files
yoshi-automationparthea
authored andcommitted
doc: update resource docstrings (#60)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(python): use BUILD_SPECIFIC_GCLOUD_PROJECT for samples https://github.com/googleapis/python-talent/blob/ef045e8eb348db36d7a2a611e6f26b11530d273b/samples/snippets/noxfile_config.py#L27-L32 `BUILD_SPECIFIC_GCLOUD_PROJECT` is an alternate project used for sample tests that do poorly with concurrent runs on the same project. Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Sep 30 13:06:03 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: 9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4 Source-Link: googleapis/synthtool@9b0da52 * chore(python): use 'setup.py' to detect repo root Closes #792 Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Fri Oct 9 15:06:33 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: e0ae456852bf22f38796deb79cff30b516fde244 Source-Link: googleapis/synthtool@e0ae456 * build(python): samples tests should pass if no samples exist Source-Author: Daniel Sanche <d.sanche14@gmail.com> Source-Date: Wed Oct 14 08:00:06 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 477764cc4ee6db346d3febef2bb1ea0abf27de52 Source-Link: googleapis/synthtool@477764c
1 parent 4f3fc28 commit 7c19fb2

File tree

8 files changed

+151
-14
lines changed

8 files changed

+151
-14
lines changed

packages/google-cloud-bigquery-storage/.kokoro/samples/python3.6/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.6"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py36"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery-storage/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-storage/.kokoro/samples/python3.7/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.7"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py37"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery-storage/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-storage/.kokoro/samples/python3.8/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.8"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py38"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-bigquery-storage/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-storage/.kokoro/test-samples.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
2828
git checkout $LATEST_RELEASE
2929
fi
3030

31+
# Exit early if samples directory doesn't exist
32+
if [ ! -d "./samples" ]; then
33+
echo "No tests run. `./samples` not found"
34+
exit 0
35+
fi
36+
3137
# Disable buffering, so that the logs stream through.
3238
export PYTHONUNBUFFERED=1
3339

@@ -101,4 +107,4 @@ cd "$ROOT"
101107
# Workaround for Kokoro permissions issue: delete secrets
102108
rm testing/{test-env.sh,client-secrets.json,service-account.json}
103109

104-
exit "$RTN"
110+
exit "$RTN"

packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1/services/big_query_read/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
from distutils import util
2020
import os
2121
import re
22-
from typing import Callable, Dict, Iterable, Sequence, Tuple, Type, Union
22+
from typing import Callable, Dict, Optional, Iterable, Sequence, Tuple, Type, Union
2323
import pkg_resources
2424

25-
import google.api_core.client_options as ClientOptions # type: ignore
25+
from google.api_core import client_options as client_options_lib # type: ignore
2626
from google.api_core import exceptions # type: ignore
2727
from google.api_core import gapic_v1 # type: ignore
2828
from google.api_core import retry as retries # type: ignore
@@ -170,9 +170,9 @@ def parse_read_stream_path(path: str) -> Dict[str, str]:
170170
def __init__(
171171
self,
172172
*,
173-
credentials: credentials.Credentials = None,
174-
transport: Union[str, BigQueryReadTransport] = None,
175-
client_options: ClientOptions = None,
173+
credentials: Optional[credentials.Credentials] = None,
174+
transport: Union[str, BigQueryReadTransport, None] = None,
175+
client_options: Optional[client_options_lib.ClientOptions] = None,
176176
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
177177
) -> None:
178178
"""Instantiate the big query read client.
@@ -186,8 +186,8 @@ def __init__(
186186
transport (Union[str, ~.BigQueryReadTransport]): The
187187
transport to use. If set to None, a transport is chosen
188188
automatically.
189-
client_options (ClientOptions): Custom options for the client. It
190-
won't take effect if a ``transport`` instance is provided.
189+
client_options (client_options_lib.ClientOptions): Custom options for the
190+
client. It won't take effect if a ``transport`` instance is provided.
191191
(1) The ``api_endpoint`` property can be used to override the
192192
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
193193
environment variable can also be used to override the endpoint:
@@ -213,9 +213,9 @@ def __init__(
213213
creation failed for any reason.
214214
"""
215215
if isinstance(client_options, dict):
216-
client_options = ClientOptions.from_dict(client_options)
216+
client_options = client_options_lib.from_dict(client_options)
217217
if client_options is None:
218-
client_options = ClientOptions.ClientOptions()
218+
client_options = client_options_lib.ClientOptions()
219219

220220
# Create SSL credentials for mutual TLS if needed.
221221
use_client_cert = bool(

packages/google-cloud-bigquery-storage/samples/quickstart/noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ def _get_repo_root():
199199
break
200200
if Path(p / ".git").exists():
201201
return str(p)
202+
# .git is not available in repos cloned via Cloud Build
203+
# setup.py is always in the library's root, so use that instead
204+
# https://github.com/googleapis/synthtool/issues/792
205+
if Path(p / "setup.py").exists():
206+
return str(p)
202207
p = p.parent
203208
raise Exception("Unable to detect repository root.")
204209

packages/google-cloud-bigquery-storage/samples/to_dataframe/noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ def _get_repo_root():
199199
break
200200
if Path(p / ".git").exists():
201201
return str(p)
202+
# .git is not available in repos cloned via Cloud Build
203+
# setup.py is always in the library's root, so use that instead
204+
# https://github.com/googleapis/synthtool/issues/792
205+
if Path(p / "setup.py").exists():
206+
return str(p)
202207
p = p.parent
203208
raise Exception("Unable to detect repository root.")
204209

packages/google-cloud-bigquery-storage/synth.metadata

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "git@github.com:plamut/python-bigquery-storage.git",
7-
"sha": "bb1fdd26638add930e6601663ca92b76cbd9064c"
6+
"remote": "https://github.com/googleapis/python-bigquery-storage.git",
7+
"sha": "6254bf2a588e69e2175df1c67edb514655d93e9d"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "googleapis",
13+
"remote": "https://github.com/googleapis/googleapis.git",
14+
"sha": "062f46f246c78fde2160524db593fa0fa7bdbe64",
15+
"internalRef": "337404700"
816
}
917
},
1018
{
1119
"git": {
1220
"name": "synthtool",
1321
"remote": "https://github.com/googleapis/synthtool.git",
14-
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
22+
"sha": "477764cc4ee6db346d3febef2bb1ea0abf27de52"
1523
}
1624
},
1725
{
1826
"git": {
1927
"name": "synthtool",
2028
"remote": "https://github.com/googleapis/synthtool.git",
21-
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
29+
"sha": "477764cc4ee6db346d3febef2bb1ea0abf27de52"
2230
}
2331
}
2432
],
@@ -32,5 +40,100 @@
3240
"generator": "bazel"
3341
}
3442
}
43+
],
44+
"generatedFiles": [
45+
".flake8",
46+
".github/CONTRIBUTING.md",
47+
".github/ISSUE_TEMPLATE/bug_report.md",
48+
".github/ISSUE_TEMPLATE/feature_request.md",
49+
".github/ISSUE_TEMPLATE/support_request.md",
50+
".github/PULL_REQUEST_TEMPLATE.md",
51+
".github/release-please.yml",
52+
".github/snippet-bot.yml",
53+
".gitignore",
54+
".kokoro/build.sh",
55+
".kokoro/continuous/common.cfg",
56+
".kokoro/continuous/continuous.cfg",
57+
".kokoro/docker/docs/Dockerfile",
58+
".kokoro/docker/docs/fetch_gpg_keys.sh",
59+
".kokoro/docs/common.cfg",
60+
".kokoro/docs/docs-presubmit.cfg",
61+
".kokoro/docs/docs.cfg",
62+
".kokoro/populate-secrets.sh",
63+
".kokoro/presubmit/common.cfg",
64+
".kokoro/presubmit/presubmit.cfg",
65+
".kokoro/publish-docs.sh",
66+
".kokoro/release.sh",
67+
".kokoro/release/common.cfg",
68+
".kokoro/release/release.cfg",
69+
".kokoro/samples/lint/common.cfg",
70+
".kokoro/samples/lint/continuous.cfg",
71+
".kokoro/samples/lint/periodic.cfg",
72+
".kokoro/samples/lint/presubmit.cfg",
73+
".kokoro/samples/python3.6/common.cfg",
74+
".kokoro/samples/python3.6/continuous.cfg",
75+
".kokoro/samples/python3.6/periodic.cfg",
76+
".kokoro/samples/python3.6/presubmit.cfg",
77+
".kokoro/samples/python3.7/common.cfg",
78+
".kokoro/samples/python3.7/continuous.cfg",
79+
".kokoro/samples/python3.7/periodic.cfg",
80+
".kokoro/samples/python3.7/presubmit.cfg",
81+
".kokoro/samples/python3.8/common.cfg",
82+
".kokoro/samples/python3.8/continuous.cfg",
83+
".kokoro/samples/python3.8/periodic.cfg",
84+
".kokoro/samples/python3.8/presubmit.cfg",
85+
".kokoro/test-samples.sh",
86+
".kokoro/trampoline.sh",
87+
".kokoro/trampoline_v2.sh",
88+
".trampolinerc",
89+
"CODE_OF_CONDUCT.md",
90+
"CONTRIBUTING.rst",
91+
"LICENSE",
92+
"MANIFEST.in",
93+
"docs/_static/custom.css",
94+
"docs/_templates/layout.html",
95+
"docs/bigquery_storage_v1/services.rst",
96+
"docs/bigquery_storage_v1/types.rst",
97+
"docs/conf.py",
98+
"docs/multiprocessing.rst",
99+
"google/cloud/bigquery_storage/__init__.py",
100+
"google/cloud/bigquery_storage/py.typed",
101+
"google/cloud/bigquery_storage_v1/proto/arrow.proto",
102+
"google/cloud/bigquery_storage_v1/proto/avro.proto",
103+
"google/cloud/bigquery_storage_v1/proto/storage.proto",
104+
"google/cloud/bigquery_storage_v1/proto/stream.proto",
105+
"google/cloud/bigquery_storage_v1/py.typed",
106+
"google/cloud/bigquery_storage_v1/services/__init__.py",
107+
"google/cloud/bigquery_storage_v1/services/big_query_read/__init__.py",
108+
"google/cloud/bigquery_storage_v1/services/big_query_read/async_client.py",
109+
"google/cloud/bigquery_storage_v1/services/big_query_read/client.py",
110+
"google/cloud/bigquery_storage_v1/services/big_query_read/transports/__init__.py",
111+
"google/cloud/bigquery_storage_v1/services/big_query_read/transports/base.py",
112+
"google/cloud/bigquery_storage_v1/services/big_query_read/transports/grpc.py",
113+
"google/cloud/bigquery_storage_v1/services/big_query_read/transports/grpc_asyncio.py",
114+
"google/cloud/bigquery_storage_v1/types/__init__.py",
115+
"google/cloud/bigquery_storage_v1/types/arrow.py",
116+
"google/cloud/bigquery_storage_v1/types/avro.py",
117+
"google/cloud/bigquery_storage_v1/types/storage.py",
118+
"google/cloud/bigquery_storage_v1/types/stream.py",
119+
"mypy.ini",
120+
"noxfile.py",
121+
"renovate.json",
122+
"samples/AUTHORING_GUIDE.md",
123+
"samples/CONTRIBUTING.md",
124+
"samples/quickstart/noxfile.py",
125+
"samples/to_dataframe/noxfile.py",
126+
"scripts/decrypt-secrets.sh",
127+
"scripts/fixup_bigquery_storage_v1_keywords.py",
128+
"scripts/readme-gen/readme_gen.py",
129+
"scripts/readme-gen/templates/README.tmpl.rst",
130+
"scripts/readme-gen/templates/auth.tmpl.rst",
131+
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
132+
"scripts/readme-gen/templates/install_deps.tmpl.rst",
133+
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
134+
"setup.cfg",
135+
"testing/.gitignore",
136+
"tests/unit/gapic/bigquery_storage_v1/__init__.py",
137+
"tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py"
35138
]
36139
}

0 commit comments

Comments
 (0)