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

Commit fb73bd7

Browse files
authored
fix: remove unnecessary double quotes in strings (#262)
Change-Id: I79373e42991c2872ff0f8be215bbfa5b4b460f0c
1 parent 81c2d9a commit fb73bd7

File tree

1 file changed

+21
-41
lines changed

1 file changed

+21
-41
lines changed

google/cloud/automl_v1beta1/services/tables/tables_client.py

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ def __lookup_by_display_name(self, object_type, items, display_name):
207207
else:
208208
raise ValueError(
209209
(
210-
"Multiple {}s match display_name='{}': {}\n\n"
211-
"Please use the `.name` (unique identifier) field instead"
210+
"Multiple {}s match display_name='{}': {}. Please use the `.name` (unique identifier) field instead."
212211
).format(
213212
object_type,
214213
display_name,
@@ -220,18 +219,14 @@ def __location_path(self, *, project=None, region=None):
220219
if project is None:
221220
if self.project is None:
222221
raise ValueError(
223-
"Either initialize your client with a value "
224-
"for 'project', or provide 'project' as a "
225-
"parameter for this method."
222+
"Either initialize your client with a value for 'project', or provide 'project' as a parameter for this method."
226223
)
227224
project = self.project
228225

229226
if region is None:
230227
if self.region is None:
231228
raise ValueError(
232-
"Either initialize your client with a value "
233-
"for 'region', or provide 'region' as a "
234-
"parameter for this method."
229+
"Either initialize your client with a value for 'region', or provide 'region' as a parameter for this method."
235230
)
236231
region = self.region
237232

@@ -259,8 +254,7 @@ def __dataset_from_args(
259254
):
260255
if dataset is None and dataset_display_name is None and dataset_name is None:
261256
raise ValueError(
262-
"One of 'dataset', 'dataset_name' or "
263-
"'dataset_display_name' must be set."
257+
"One of 'dataset', 'dataset_name' or 'dataset_display_name' must be set."
264258
)
265259
# we prefer to make a live call here in the case that the
266260
# dataset object is out-of-date
@@ -285,7 +279,7 @@ def __model_from_args(
285279
):
286280
if model is None and model_display_name is None and model_name is None:
287281
raise ValueError(
288-
"One of 'model', 'model_name' or " "'model_display_name' must be set."
282+
"One of 'model', 'model_name' or 'model_display_name' must be set."
289283
)
290284
# we prefer to make a live call here in the case that the
291285
# model object is out-of-date
@@ -310,8 +304,7 @@ def __dataset_name_from_args(
310304
):
311305
if dataset is None and dataset_display_name is None and dataset_name is None:
312306
raise ValueError(
313-
"One of 'dataset', 'dataset_name' or "
314-
"'dataset_display_name' must be set."
307+
"One of 'dataset', 'dataset_name' or 'dataset_display_name' must be set."
315308
)
316309

317310
if dataset_name is None:
@@ -362,7 +355,7 @@ def __model_name_from_args(
362355
):
363356
if model is None and model_display_name is None and model_name is None:
364357
raise ValueError(
365-
"One of 'model', 'model_name' or " "'model_display_name' must be set."
358+
"One of 'model', 'model_name' or 'model_display_name' must be set."
366359
)
367360

368361
if model_name is None:
@@ -391,12 +384,7 @@ def __log_operation_info(self, message, op):
391384
pass
392385
_LOGGER.info(
393386
(
394-
"Operation '{}' is running in the background. The returned "
395-
"Operation '{}' can be used to query or block on the status "
396-
"of this operation. Ending your python session will _not_ "
397-
"cancel this operation. Read the documentation here:\n\n"
398-
"\thttps://googleapis.dev/python/google-api-core/latest/operation.html\n\n"
399-
"for more information on the Operation class."
387+
"Operation '{}' is running in the background. The returned Operation '{}' can be used to query or block on the status of this operation. Ending your python session will _not_ cancel this operation. Read the documentation here:\n\n \thttps://googleapis.dev/python/google-api-core/latest/operation.html\n\n for more information on the Operation class."
400388
).format(message, name)
401389
)
402390
return op
@@ -427,8 +415,7 @@ def __column_spec_name_from_args(
427415
column_specs = {s.display_name: s for s in column_specs}
428416
if column_specs.get(column_spec_display_name) is None:
429417
raise exceptions.NotFound(
430-
"No column with "
431-
+ "column_spec_display_name: '{}' found".format(
418+
"No column with column_spec_display_name: '{}' found".format(
432419
column_spec_display_name
433420
)
434421
)
@@ -437,13 +424,13 @@ def __column_spec_name_from_args(
437424
column_specs = {s.name: s for s in column_specs}
438425
if column_specs.get(column_spec_name) is None:
439426
raise exceptions.NotFound(
440-
"No column with "
441-
+ "column_spec_name: '{}' found".format(column_spec_name)
427+
"No column with column_spec_name: '{}' found".format(
428+
column_spec_name
429+
)
442430
)
443431
else:
444432
raise ValueError(
445-
"Either supply 'column_spec_name' or "
446-
"'column_spec_display_name' for the column to update"
433+
"Either supply 'column_spec_name' or 'column_spec_display_name' for the column to update"
447434
)
448435

449436
return column_spec_name
@@ -471,10 +458,10 @@ def __process_request_kwargs(self, request, **kwargs):
471458
472459
Some kwargs are for the request object and others are for
473460
the method itself (retry, metdata).
474-
461+
475462
Args:
476463
request (proto.Message) The request object.
477-
464+
478465
Returns:
479466
dict: kwargs to be added to the method.
480467
"""
@@ -596,7 +583,7 @@ def get_dataset(
596583
"""
597584
if dataset_name is None and dataset_display_name is None:
598585
raise ValueError(
599-
"One of 'dataset_name' or " "'dataset_display_name' must be set."
586+
"One of 'dataset_name' or 'dataset_display_name' must be set."
600587
)
601588

602589
if dataset_name is not None:
@@ -2326,18 +2313,15 @@ def create_model(
23262313
or train_budget_milli_node_hours > 72000
23272314
):
23282315
raise ValueError(
2329-
"'train_budget_milli_node_hours' must be a "
2330-
"value between 1,000 and 72,000 inclusive"
2316+
"'train_budget_milli_node_hours' must be a value between 1,000 and 72,000 inclusive"
23312317
)
23322318

23332319
if exclude_column_spec_names not in [
23342320
None,
23352321
[],
23362322
] and include_column_spec_names not in [None, []]:
23372323
raise ValueError(
2338-
"Cannot set both "
2339-
"'exclude_column_spec_names' and "
2340-
"'include_column_spec_names'"
2324+
"Cannot set both 'exclude_column_spec_names' and 'include_column_spec_names'"
23412325
)
23422326

23432327
dataset_name = self.__dataset_name_from_args(
@@ -2575,9 +2559,7 @@ def get_model(
25752559
ValueError: If required parameters are missing.
25762560
"""
25772561
if model_name is None and model_display_name is None:
2578-
raise ValueError(
2579-
"One of 'model_name' or " "'model_display_name' must be set."
2580-
)
2562+
raise ValueError("One of 'model_name' or 'model_display_name' must be set.")
25812563

25822564
if model_name is not None:
25832565
return self.auto_ml_client.get_model(name=model_name)
@@ -2824,9 +2806,7 @@ def predict(
28242806
if len(inputs) != len(column_specs):
28252807
raise ValueError(
28262808
(
2827-
"Dimension mismatch, the number of provided "
2828-
"inputs ({}) does not match that of the model "
2829-
"({})"
2809+
"Dimension mismatch, the number of provided inputs ({}) does not match that of the model ({})"
28302810
).format(len(inputs), len(column_specs))
28312811
)
28322812

@@ -2980,7 +2960,7 @@ def batch_predict(
29802960
input_request = {"bigquery_source": {"input_uri": bigquery_input_uri}}
29812961
else:
29822962
raise ValueError(
2983-
"One of 'gcs_input_uris'/'bigquery_input_uris' must" "be set"
2963+
"One of 'gcs_input_uris'/'bigquery_input_uris' must be set"
29842964
)
29852965

29862966
output_request = None

0 commit comments

Comments
 (0)