8000 fix!: avoid collision with built-in functions by renaming type proper… · googleapis/google-cloud-python@e7cb216 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7cb216

Browse files
yoshi-automationTakashi Matsuo
andauthored
fix!: avoid collision with built-in functions by renaming type property to type_ (#53)
BREAKING CHANGE: type is renamed to type_ to avoid conflict with built-in functions (introduced in googleapis/gapic-generator-python#595) * 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 Co-authored-by: Takashi Matsuo <tmatsuo@google.com>
1 parent 455293a commit e7cb216

File tree

8 files changed

+136
-15
lines changed

8 files changed

+136
-15
lines changed

packages/google-cloud-bigquery-datatransfer/.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-datatransfer/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-datatransfer/.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-datatransfer/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-datatransfer/.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-datatransfer/.kokoro/test-samples.sh"

packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/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, Sequence, Tuple, Type, Union
22+
from typing import Callable, Dict, Optional, 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
@@ -161,9 +161,9 @@ def parse_transfer_config_path(path: str) -> Dict[str, str]:
161161
def __init__(
162162
self,
163163
*,
164-
credentials: credentials.Credentials = None,
165-
transport: Union[str, DataTransferServiceTransport] = None,
166-
client_options: ClientOptions = None,
164+
credentials: Optional[credentials.Credentials] = None,
165+
transport: Union[str, DataTransferServiceTransport, None] = None,
166+
client_options: Optional[client_options_lib.ClientOptions] = None,
167167
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
168168
) -> None:
169169
"""Instantiate the data transfer service client.
@@ -177,8 +177,8 @@ def __init__(
177177
transport (Union[str, ~.DataTransferServiceTransport]): The
178178
transport to use. If set to None, a transport is chosen
179179
automatically.
180-
client_options (ClientOptions): Custom options for the client. It
181-
won't take effect if a ``transport`` instance is provided.
180+
client_options (client_options_lib.ClientOptions): Custom options for the
181+
client. It won't take effect if a ``transport`` instance is provided.
182182
(1) The ``api_endpoint`` property can be used to override the
183183
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
184184
environment variable can also be used to override the endpoint:
@@ -204,9 +204,9 @@ def __init__(
204204
creation failed for any reason.
205205
"""
206206
if isinstance(client_options, dict):
207-
client_options = ClientOptions.from_dict(client_options)
207+
client_options = client_options_lib.from_dict(client_options)
208208
if client_options is None:
209-
client_options = ClientOptions.ClientOptions()
209+
client_options = client_options_lib.ClientOptions()
210210

211211
# Create SSL credentials for mutual TLS if needed.
212212
use_client_cert = bool(

packages/google-cloud-bigquery-datatransfer/google/cloud/bigquery_datatransfer_v1/types/datatransfer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class DataSourceParameter(proto.Message):
7070
Parameter display name in the user interface.
7171
description (str):
7272
Parameter description.
73-
type (~.datatransfer.DataSourceParameter.Type):
73+
type_ (~.datatransfer.DataSourceParameter.Type):
7474
Parameter type.
7575
required (bool):
7676
Is parameter required.
@@ -122,7 +122,7 @@ class Type(proto.Enum):
122122

123123
description = proto.Field(proto.STRING, number=3)
124124

125-
type = proto.Field(proto.ENUM, number=4, enum=Type,)
125+
type_ = proto.Field(proto.ENUM, number=4, enum=Type,)
126126

127127
required = proto.Field(proto.BOOL, number=5)
128128

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md

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

Lines changed: 105 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-datatransfer.git",
7-
"sha": "41256eec1994fbff48894c7055e6440b4e636628"
6+
"remote": "https://github.com/googleapis/python-bigquery-datatransfer.git",
7+
"sha": "cc2b9ff311dfa6ec9d181d4c2a4c952a609f5dec"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "googleapis",
13+
"remote": "https://github.com/googleapis/googleapis.git",
14+
"sha": "eabe7c0fde64b1451df6ea171b2009238b0df07c",
15+
"internalRef": "335110052"
816
}
917
},
1018
{
1119
"git": {
1220
"name": "synthtool",
1321
"remote": "https://github.com/googleapis/synthtool.git",
14-
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
22+
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
1523
}
1624
},
1725
{
1826
"git": {
1927
"name": "synthtool",
2028
"remote": "https://github.com/googleapis/synthtool.git",
21-
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
29+
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
2230
}
2331
}
2432
],
@@ -32,5 +40,98 @@
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_datatransfer_v1/services.rst",
96+
"docs/bigquery_datatransfer_v1/types.rst",
97+
"docs/conf.py",
98+
"docs/multiprocessing.rst",
99+
"google/cloud/bigquery_datatransfer/__init__.py",
100+
"google/cloud/bigquery_datatransfer/py.typed",
101+
"google/cloud/bigquery_datatransfer_v1/__init__.py",
102+
"google/cloud/bigquery_datatransfer_v1/proto/datatransfer.proto",
103+
"google/cloud/bigquery_datatransfer_v1/proto/transfer.proto",
104+
"google/cloud/bigquery_datatransfer_v1/py.typed",
105+
"google/cloud/bigquery_datatransfer_v1/services/__init__.py",
106+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/__init__.py",
107+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py",
108+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py",
109+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/pagers.py",
110+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/__init__.py",
111+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py",
112+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py",
113+
"google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py",
114+
"google/cloud/bigquery_datatransfer_v1/types/__init__.py",
115+
"google/cloud/bigquery_datatransfer_v1/types/datatransfer.py",
116+
"google/cloud/bigquery_datatransfer_v1/types/transfer.py",
117+
"mypy.ini",
118+
"noxfile.py",
119+
"renovate.json",
120+
"samples/AUTHORING_GUIDE.md",
121+
"samples/CONTRIBUTING.md",
122+
"samples/noxfile.py",
123+
"samples/snippets/noxfile.py",
124+
"scripts/decrypt-secrets.sh",
125+
"scripts/fixup_bigquery_datatransfer_v1_keywords.py",
126+
"scripts/readme-gen/readme_gen.py",
127+
"scripts/readme-gen/templates/README.tmpl.rst",
128+
"scripts/readme-gen/templates/auth.tmpl.rst",
129+
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
130+
"scripts/readme-gen/templates/install_deps.tmpl.rst",
131+
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
132+
"setup.cfg",
133+
"testing/.gitignore",
134+
"tests/unit/gapic/bigquery_datatransfer_v1/__init__.py",
135+
"tests/unit/gapic/bigquery_datatransfer_v1/test_data_transfer_service.py"
35136
]
36137
}

0 commit comments

Comments
 (0)
0