Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit e5f9021

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(datalabeling): deprecate resource name helper methods (via synth) (#9832)
1 parent 4d8a20e commit e5f9021

File tree

2 files changed

+59
-14
lines changed

2 files changed

+59
-14
lines changed

google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
def annotated_dataset_path(cls, project, dataset, annotated_dataset):
93-
"""Return a fully-qualified annotated_dataset string."""
93+
"""DEPRECATED. Return a fully-qualified annotated_dataset string."""
94+
warnings.warn(
95+
"Resource name helper functions are deprecated.",
96+
PendingDeprecationWarning,
97+
stacklevel=1,
98+
)
9499
return google.api_core.path_template.expand(
95100
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}",
96101
project=project,
@@ -100,7 +105,12 @@ def annotated_dataset_path(cls, project, dataset, annotated_dataset):
100105

101106
@classmethod
102107
def annotation_spec_set_path(cls, project, annotation_spec_set):
103-
"""Return a fully-qualified annotation_spec_set string."""
108+
"""DEPRECATED. Return a fully-qualified annotation_spec_set string."""
109+
warnings.warn(
110+
"Resource name helper functions are deprecated.",
111+
PendingDeprecationWarning,
112+
stacklevel=1,
113+
)
104114
return google.api_core.path_template.expand(
105115
"projects/{project}/annotationSpecSets/{annotation_spec_set}",
106116
project=project,
@@ -109,7 +119,12 @@ def annotation_spec_set_path(cls, project, annotation_spec_set):
109119

110120
@classmethod
111121
def data_item_path(cls, project, dataset, data_item):
112-
"""Return a fully-qualified data_item string."""
122+
"""DEPRECATED. Return a fully-qualified data_item string."""
123+
warnings.warn(
124+
"Resource name helper functions are deprecated.",
125+
PendingDeprecationWarning,
126+
stacklevel=1,
127+
)
113128
return google.api_core.path_template.expand(
114129
"projects/{project}/datasets/{dataset}/dataItems/{data_item}",
115130
project=project,
@@ -119,14 +134,24 @@ def data_item_path(cls, project, dataset, data_item):
119134

120135
@classmethod
121136
def dataset_path(cls, project, dataset):
122-
"""Return a fully-qualified dataset string."""
137+
"""DEPRECATED. Return a fully-qualified dataset string."""
138+
warnings.warn(
139+
"Resource name helper functions are deprecated.",
140+
PendingDeprecationWarning,
141+
stacklevel=1,
142+
)
123143
return google.api_core.path_template.expand(
124144
"projects/{project}/datasets/{dataset}", project=project, dataset=dataset
125145
)
126146

127147
@classmethod
128148
def evaluation_path(cls, project, dataset, evaluation):
129-
"""Return a fully-qualified evaluation string."""
149+
"""DEPRECATED. Return a fully-qualified evaluation string."""
150+
warnings.warn(
151+
"Resource name helper functions are deprecated.",
152+
PendingDeprecationWarning,
153+
stacklevel=1,
154+
)
130155
return google.api_core.path_template.expand(
131156
"projects/{project}/datasets/{dataset}/evaluations/{evaluation}",
132157
project=project,
@@ -136,7 +161,12 @@ def evaluation_path(cls, project, dataset, evaluation):
136161

137162
@classmethod
138163
def evaluation_job_path(cls, project, evaluation_job):
139-
"""Return a fully-qualified evaluation_job string."""
164+
"""DEPRECATED. Return a fully-qualified evaluation_job string."""
165+
warnings.warn(
166+
"Resource name helper functions are deprecated.",
167+
PendingDeprecationWarning,
168+
stacklevel=1,
169+
)
140170
return google.api_core.path_template.expand(
141171
"projects/{project}/evaluationJobs/{evaluation_job}",
142172
project=project,
@@ -145,7 +175,12 @@ def evaluation_job_path(cls, project, evaluation_job):
145175

146176
@classmethod
147177
def example_path(cls, project, dataset, annotated_dataset, example):
148-
"""Return a fully-qualified example string."""
178+
"""DEPRECATED. Return a fully-qualified example string."""
179+
warnings.warn(
180+
"Resource name helper functions are deprecated.",
181+
PendingDeprecationWarning,
182+
stacklevel=1,
183+
)
149184
return google.api_core.path_template.expand(
150185
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
151186
project=project,
@@ -156,7 +191,12 @@ def example_path(cls, project, dataset, annotated_dataset, example):
156191

157192
@classmethod
158193
def instruction_path(cls, project, instruction):
159-
"""Return a fully-qualified instruction string."""
194+
"""DEPRECATED. Return a fully-qualified instruction string."""
195+
warnings.warn(
196+
"Resource name helper functions are deprecated.",
197+
PendingDeprecationWarning,
198+
stacklevel=1,
199+
)
160200
return google.api_core.path_template.expand(
161201
"projects/{project}/instructions/{instruction}",
162202
project=project,
@@ -165,7 +205,12 @@ def instruction_path(cls, project, instruction):
165205

166206
@classmethod
167207
def project_path(cls, project):
168-
"""Return a fully-qualified project string."""
208+
"""DEPRECATED. Return a fully-qualified project string."""
209+
warnings.warn(
210+
"Resource name helper functions are deprecated.",
211+
PendingDeprecationWarning,
212+
stacklevel=1,
213+
)
169214
return google.api_core.path_template.expand(
170215
"projects/{project}", project=project
171216
)

synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-11-16T13:18:46.021984Z",
2+
"updateTime": "2019-11-19T13:20:27.854150Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.41.1",
8-
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
7+
"version": "0.42.1",
8+
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "c89394342a9ef70acaf73a6959e04b943fbc817b",
16-
"internalRef": "280761373"
15+
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
16+
"internalRef": "281088257"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)