Skip to content

Commit a6fc8bd

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(automl): deprecate resource name helper methods, update docs configuration (via synth) (#9828)
1 parent 5349250 commit a6fc8bd

File tree

6 files changed

+90
-20
lines changed

6 files changed

+90
-20
lines changed

automl/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
# Add any paths that contain custom static files (such as style sheets) here,
165165
# relative to this directory. They are copied after the builtin static files,
166166
# so a file named "default.css" will overwrite the builtin "default.css".
167-
# html_static_path = []
167+
html_static_path = ["_static"]
168168

169169
# Add any extra paths that contain custom files (such as robots.txt or
170170
# .htaccess) here, relative to this directory. These files are copied

automl/google/cloud/automl_v1/gapic/auto_ml_client.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
101101

102102
@classmethod
103103
def annotation_spec_path(cls, project, location, dataset, annotation_spec):
104-
"""Return a fully-qualified annotation_spec string."""
104+
"""DEPRECATED. Return a fully-qualified annotation_spec string."""
105+
warnings.warn(
106+
"Resource name helper functions are deprecated.",
107+
PendingDeprecationWarning,
108+
stacklevel=1,
109+
)
105110
return google.api_core.path_template.expand(
106111
"projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}",
107112
project=project,
@@ -112,7 +117,12 @@ def annotation_spec_path(cls, project, location, dataset, annotation_spec):
112117

113118
@classmethod
114119
def dataset_path(cls, project, location, dataset):
115-
"""Return a fully-qualified dataset string."""
120+
"""DEPRECATED. Return a fully-qualified dataset string."""
121+
warnings.warn(
122+
"Resource name helper functions are deprecated.",
123+
PendingDeprecationWarning,
124+
stacklevel=1,
125+
)
116126
return google.api_core.path_template.expand(
117127
"projects/{project}/locations/{location}/datasets/{dataset}",
118128
project=project,
@@ -122,7 +132,12 @@ def dataset_path(cls, project, location, dataset):
122132

123133
@classmethod
124134
def location_path(cls, project, location):
125-
"""Return a fully-qualified location string."""
135+
"""DEPRECATED. Return a fully-qualified location string."""
136+
warnings.warn(
137+
"Resource name helper functions are deprecated.",
138+
PendingDeprecationWarning,
139+
stacklevel=1,
140+
)
126141
return google.api_core.path_template.expand(
127142
"projects/{project}/locations/{location}",
128143
project=project,
@@ -131,7 +146,12 @@ def location_path(cls, project, location):
131146

132147
@classmethod
133148
def model_path(cls, project, location, model):
134-
"""Return a fully-qualified model string."""
149+
"""DEPRECATED. Return a fully-qualified model string."""
150+
warnings.warn(
151+
"Resource name helper functions are deprecated.",
152+
PendingDeprecationWarning,
153+
stacklevel=1,
154+
)
135155
return google.api_core.path_template.expand(
136156
"projects/{project}/locations/{location}/models/{model}",
137157
project=project,
@@ -141,7 +161,12 @@ def model_path(cls, project, location, model):
141161

142162
@classmethod
143163
def model_evaluation_path(cls, project, location, model, model_evaluation):
144-
"""Return a fully-qualified model_evaluation string."""
164+
"""DEPRECATED. Return a fully-qualified model_evaluation string."""
165+
warnings.warn(
166+
"Resource name helper functions are deprecated.",
167+
PendingDeprecationWarning,
168+
stacklevel=1,
169+
)
145170
return google.api_core.path_template.expand(
146171
"projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}",
147172
project=project,

automl/google/cloud/automl_v1/gapic/prediction_service_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9191

9292
@classmethod
9393
def model_path(cls, project, location, model):
94-
"""Return a fully-qualified model string."""
94+
"""DEPRECATED. Return a fully-qualified model string."""
95+
warnings.warn(
96+
"Resource name helper functions are deprecated.",
97+
PendingDeprecationWarning,
98+
stacklevel=1,
99+
)
95100
return google.api_core.path_template.expand(
96101
"projects/{project}/locations/{location}/models/{model}",
97102
project=project,

automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
103103

104104
@classmethod
105105
def annotation_spec_path(cls, project, location, dataset, annotation_spec):
106-
"""Return a fully-qualified annotation_spec string."""
106+
"""DEPRECATED. Return a fully-qualified annotation_spec string."""
107+
warnings.warn(
108+
"Resource name helper functions are deprecated.",
109+
PendingDeprecationWarning,
110+
stacklevel=1,
111+
)
107112
return google.api_core.path_template.expand(
108113
"projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}",
109114
project=project,
@@ -114,7 +119,12 @@ def annotation_spec_path(cls, project, location, dataset, annotation_spec):
114119

115120
@classmethod
116121
def column_spec_path(cls, project, location, dataset, table_spec, column_spec):
117-
"""Return a fully-qualified column_spec string."""
122+
"""DEPRECATED. Return a fully-qualified column_spec string."""
123+
warnings.warn(
124+
"Resource name helper functions are deprecated.",
125+
PendingDeprecationWarning,
126+
stacklevel=1,
127+
)
118128
return google.api_core.path_template.expand(
119129
"projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}",
120130
project=project,
@@ -126,7 +136,12 @@ def column_spec_path(cls, project, location, dataset, table_spec, column_spec):
126136

127137
@classmethod
128138
def dataset_path(cls, project, location, dataset):
129-
"""Return a fully-qualified dataset string."""
139+
"""DEPRECATED. Return a fully-qualified dataset string."""
140+
warnings.warn(
141+
"Resource name helper functions are deprecated.",
142+
PendingDeprecationWarning,
143+
stacklevel=1,
144+
)
130145
return google.api_core.path_template.expand(
131146
"projects/{project}/locations/{location}/datasets/{dataset}",
132147
project=project,
@@ -136,7 +151,12 @@ def dataset_path(cls, project, location, dataset):
136151

137152
@classmethod
138153
def location_path(cls, project, location):
139-
"""Return a fully-qualified location string."""
154+
"""DEPRECATED. Return a fully-qualified location string."""
155+
warnings.warn(
156+
"Resource name helper functions are deprecated.",
157+
PendingDeprecationWarning,
158+
stacklevel=1,
159+
)
140160
return google.api_core.path_template.expand(
141161
"projects/{project}/locations/{location}",
142162
project=project,
@@ -145,7 +165,12 @@ def location_path(cls, project, location):
145165

146166
@classmethod
147167
def model_path(cls, project, location, model):
148-
"""Return a fully-qualified model string."""
168+
"""DEPRECATED. Return a fully-qualified model string."""
169+
warnings.warn(
170+
"Resource name helper functions are deprecated.",
171+
PendingDeprecationWarning,
172+
stacklevel=1,
173+
)
149174
return google.api_core.path_template.expand(
150175
"projects/{project}/locations/{location}/models/{model}",
151176
project=project,
@@ -155,7 +180,12 @@ def model_path(cls, project, location, model):
155180

156181
@classmethod
157182
def model_evaluation_path(cls, project, location, model, model_evaluation):
158-
"""Return a fully-qualified model_evaluation string."""
183+
"""DEPRECATED. Return a fully-qualified model_evaluation string."""
184+
warnings.warn(
185+
"Resource name helper functions are deprecated.",
186+
PendingDeprecationWarning,
187+
stacklevel=1,
188+
)
159189
return google.api_core.path_template.expand(
160190
"projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}",
161191
project=project,
@@ -166,7 +196,12 @@ def model_evaluation_path(cls, project, location, model, model_evaluation):
166196

167197
@classmethod
168198
def table_spec_path(cls, project, location, dataset, table_spec):
169-
"""Return a fully-qualified table_spec string."""
199+
"""DEPRECATED. Return a fully-qualified table_spec string."""
200+
warnings.warn(
201+
"Resource name helper functions are deprecated.",
202+
PendingDeprecationWarning,
203+
stacklevel=1,
204+
)
170205
return google.api_core.path_template.expand(
171206
"projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}",
172207
project=project,

automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9595

9696
@classmethod
9797
def model_path(cls, project, location, model):
98-
"""Return a fully-qualified model string."""
98+
"""DEPRECATED. Return a fully-qualified model string."""
99+
warnings.warn(
100+
"Resource name helper functions are deprecated.",
101+
PendingDeprecationWarning,
102+
stacklevel=1,
103+
)
99104
return google.api_core.path_template.expand(
100105
"projects/{project}/locations/{location}/models/{model}",
101106
project=project,

automl/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:13:10.249431Z",
2+
"updateTime": "2019-11-19T13:13:53.848416Z",
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)