Skip to content

Commit c165d1f

Browse files
feat(bigquerydatatransfer): undeprecate resource name helper methods; add py2 deprecation warning; bump copyright year to 2020 (via synth) (#10226)
1 parent e40e711 commit c165d1f

14 files changed

+123
-3444
lines changed

bigquery_datatransfer/google/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

bigquery_datatransfer/google/cloud/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

bigquery_datatransfer/google/cloud/bigquery_datatransfer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/__init__.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,12 +16,23 @@
1616

1717

1818
from __future__ import absolute_import
19+
import sys
20+
import warnings
1921

2022
from google.cloud.bigquery_datatransfer_v1 import types
2123
from google.cloud.bigquery_datatransfer_v1.gapic import data_transfer_service_client
2224
from google.cloud.bigquery_datatransfer_v1.gapic import enums
2325

2426

27+
if sys.version_info[:2] == (2, 7):
28+
message = (
29+
"A future version of this library will drop support for Python 2.7."
30+
"More details about Python 2 support for Google Cloud Client Libraries"
31+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
32+
)
33+
warnings.warn(message, DeprecationWarning)
34+
35+
2536
class DataTransferServiceClient(data_transfer_service_client.DataTransferServiceClient):
2637
__doc__ = data_transfer_service_client.DataTransferServiceClient.__doc__
2738
enums = enums

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/data_transfer_service_client.py

+9-49
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
def location_path(cls, project, location):
93-
"""DEPRECATED. Return a fully-qualified location string."""
94-
warnings.warn(
95-
"Resource name helper functions are deprecated.",
96-
PendingDeprecationWarning,
97-
stacklevel=1,
98-
)
93+
"""Return a fully-qualified location string."""
9994
return google.api_core.path_template.expand(
10095
"projects/{project}/locations/{location}",
10196
project=project,
@@ -104,12 +99,7 @@ def location_path(cls, project, location):
10499

105100
@classmethod
106101
def location_data_source_path(cls, project, location, data_source):
107-
"""DEPRECATED. Return a fully-qualified location_data_source string."""
108-
warnings.warn(
109-
"Resource name helper functions are deprecated.",
110-
PendingDeprecationWarning,
111-
stacklevel=1,
112-
)
102+
"""Return a fully-qualified location_data_source string."""
113103
return google.api_core.path_template.expand(
114104
"projects/{project}/locations/{location}/dataSources/{data_source}",
115105
project=project,
@@ -119,12 +109,7 @@ def location_data_source_path(cls, project, location, data_source):
119109

120110
@classmethod
121111
def location_run_path(cls, project, location, transfer_config, run):
122-
"""DEPRECATED. Return a fully-qualified location_run string."""
123-
warnings.warn(
124-
"Resource name helper functions are deprecated.",
125-
PendingDeprecationWarning,
126-
stacklevel=1,
127-
)
112+
"""Return a fully-qualified location_run string."""
128113
return google.api_core.path_template.expand(
129114
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}",
130115
project=project,
@@ -135,12 +120,7 @@ def location_run_path(cls, project, location, transfer_config, run):
135120

136121
@classmethod
137122
def location_transfer_config_path(cls, project, location, transfer_config):
138-
"""DEPRECATED. Return a fully-qualified location_transfer_config string."""
139-
warnings.warn(
140-
"Resource name helper functions are deprecated.",
141-
PendingDeprecationWarning,
142-
stacklevel=1,
143-
)
123+
"""Return a fully-qualified location_transfer_config string."""
144124
return google.api_core.path_template.expand(
145125
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}",
146126
project=project,
@@ -150,24 +130,14 @@ def location_transfer_config_path(cls, project, location, transfer_config):
150130

151131
@classmethod
152132
def project_path(cls, project):
153-
"""DEPRECATED. Return a fully-qualified project string."""
154-
warnings.warn(
155-
"Resource name helper functions are deprecated.",
156-
PendingDeprecationWarning,
157-
stacklevel=1,
158-
)
133+
"""Return a fully-qualified project string."""
159134
return google.api_core.path_template.expand(
160135
"projects/{project}", project=project
161136
)
162137

163138
@classmethod
164139
def project_data_source_path(cls, project, data_source):
165-
"""DEPRECATED. Return a fully-qualified project_data_source string."""
166-
warnings.warn(
167-
"Resource name helper functions are deprecated.",
168-
PendingDeprecationWarning,
169-
stacklevel=1,
170-
)
140+
"""Return a fully-qualified project_data_source string."""
171141
return google.api_core.path_template.expand(
172142
"projects/{project}/dataSources/{data_source}",
173143
project=project,
@@ -176,12 +146,7 @@ def project_data_source_path(cls, project, data_source):
176146

177147
@classmethod
178148
def project_run_path(cls, project, transfer_config, run):
179-
"""DEPRECATED. Return a fully-qualified project_run string."""
180-
warnings.warn(
181-
"Resource name helper functions are deprecated.",
182-
PendingDeprecationWarning,
183-
stacklevel=1,
184-
)
149+
"""Return a fully-qualified project_run string."""
185150
return google.api_core.path_template.expand(
186151
"projects/{project}/transferConfigs/{transfer_config}/runs/{run}",
187152
project=project,
@@ -191,12 +156,7 @@ def project_run_path(cls, project, transfer_config, run):
191156

192157
@classmethod
193158
def project_transfer_config_path(cls, project, transfer_config):
194-
"""DEPRECATED. Return a fully-qualified project_transfer_config string."""
195-
warnings.warn(
196-
"Resource name helper functions are deprecated.",
197-
PendingDeprecationWarning,
198-
stacklevel=1,
199-
)
159+
"""Return a fully-qualified project_transfer_config string."""
200160
return google.api_core.path_template.expand(
201161
"projects/{project}/transferConfigs/{transfer_config}",
202162
project=project,

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/enums.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/transports/data_transfer_service_grpc_transport.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/proto/datatransfer_pb2.py

+33-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/proto/transfer.proto

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ option java_outer_classname = "TransferProto";
3030
option java_package = "com.google.cloud.bigquery.datatransfer.v1";
3131
option objc_class_prefix = "GCBDT";
3232
option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
33-
option (google.api.resource_definition) = {
34-
type: "bigquerydatatransfer.google.com/Parent"
35-
pattern: "projects/{project}"
36-
pattern: "projects/{project}/locations/{location}"
37-
};
3833

3934
// DEPRECATED. Represents data transfer type.
4035
enum TransferType {

0 commit comments

Comments
 (0)