@@ -207,8 +207,7 @@ def __lookup_by_display_name(self, object_type, items, display_name):
207
207
else :
208
208
raise ValueError (
209
209
(
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."
212
211
).format (
213
212
object_type ,
214
213
display_name ,
@@ -220,18 +219,14 @@ def __location_path(self, *, project=None, region=None):
220
219
if project is None :
221
220
if self .project is None :
222
221
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."
226
223
)
227
224
project = self .project
228
225
229
226
if region is None :
230
227
if self .region is None :
231
228
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."
235
230
)
236
231
region = self .region
237
232
@@ -259,8 +254,7 @@ def __dataset_from_args(
259
254
):
260
255
if dataset is None and dataset_display_name is None and dataset_name is None :
261
256
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."
264
258
)
265
259
# we prefer to make a live call here in the case that the
266
260
# dataset object is out-of-date
@@ -285,7 +279,7 @@ def __model_from_args(
285
279
):
286
280
if model is None and model_display_name is None and model_name is None :
287
281
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."
289
283
)
290
284
# we prefer to make a live call here in the case that the
291
285
# model object is out-of-date
@@ -310,8 +304,7 @@ def __dataset_name_from_args(
310
304
):
311
305
if dataset is None and dataset_display_name is None and dataset_name is None :
312
306
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."
315
308
)
316
309
317
310
if dataset_name is None :
@@ -362,7 +355,7 @@ def __model_name_from_args(
362
355
):
363
356
if model is None and model_display_name is None and model_name is None :
364
357
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."
366
359
)
367
360
368
361
if model_name is None :
@@ -391,12 +384,7 @@ def __log_operation_info(self, message, op):
391
384
pass
392
385
_LOGGER .info (
393
386
(
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
- "\t https://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 \t https://googleapis.dev/python/google-api-core/latest/operation.html\n \n for more information on the Operation class."
400
388
).format (message , name )
401
389
)
402
390
return op
@@ -427,8 +415,7 @@ def __column_spec_name_from_args(
427
415
column_specs = {s .display_name : s for s in column_specs }
428
416
if column_specs .get (column_spec_display_name ) is None :
429
417
raise exceptions .NotFound (
430
- "No column with "
431
- + "column_spec_display_name: '{}' found" .format (
418
+ "No column with column_spec_display_name: '{}' found" .format (
432
419
column_spec_display_name
433
420
)
434
421
)
@@ -437,13 +424,13 @@ def __column_spec_name_from_args(
437
424
column_specs = {s .name : s for s in column_specs }
438
425
if column_specs .get (column_spec_name ) is None :
439
426
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
+ )
442
430
)
443
431
else :
444
432
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"
447
434
)
448
435
449
436
return column_spec_name
@@ -471,10 +458,10 @@ def __process_request_kwargs(self, request, **kwargs):
471
458
472
459
Some kwargs are for the request object and others are for
473
460
the method itself (retry, metdata).
474
-
461
+
475
462
Args:
476
463
request (proto.Message) The request object.
477
-
464
+
478
465
Returns:
479
466
dict: kwargs to be added to the method.
480
467
"""
@@ -596,7 +583,7 @@ def get_dataset(
596
583
"""
597
584
if dataset_name is None and dataset_display_name is None :
598
585
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."
600
587
)
601
588
602
589
if dataset_name is not None :
@@ -2326,18 +2313,15 @@ def create_model(
2326
2313
or train_budget_milli_node_hours > 72000
2327
2314
):
2328
2315
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"
2331
2317
)
2332
2318
2333
2319
if exclude_column_spec_names not in [
2334
2320
None ,
2335
2321
[],
2336
2322
] and include_column_spec_names not in [None , []]:
2337
2323
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'"
2341
2325
)
2342
2326
2343
2327
dataset_name = self .__dataset_name_from_args (
@@ -2575,9 +2559,7 @@ def get_model(
2575
2559
ValueError: If required parameters are missing.
2576
2560
"""
2577
2561
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." )
2581
2563
2582
2564
if model_name is not None :
2583
2565
return self .auto_ml_client .get_model (name = model_name )
@@ -2824,9 +2806,7 @@ def predict(
2824
2806
if len (inputs ) != len (column_specs ):
2825
2807
raise ValueError (
2826
2808
(
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 ({})"
2830
2810
).format (len (inputs ), len (column_specs ))
2831
2811
)
2832
2812
@@ -2980,7 +2960,7 @@ def batch_predict(
2980
2960
input_request = {"bigquery_source" : {"input_uri" : bigquery_input_uri }}
2981
2961
else :
2982
2962
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"
2984
2964
)
2985
2965
2986
2966
output_request = None
0 commit comments