Content-Length: 730238 | pFad | https://www.github.com/googleapis/python-aiplatform/commit/f9aecd22fe08a97e45187b4d11c755ac3b9dfadd

6EE docs: Updated docstrings with exception error classes (#894) · googleapis/python-aiplatform@f9aecd2 · GitHub
Skip to content

Commit f9aecd2

Browse files
docs: Updated docstrings with exception error classes (#894)
Co-authored-by: sasha-gitg <44654632+sasha-gitg@users.noreply.github.com>
1 parent a06da6d commit f9aecd2

File tree

12 files changed

+25
-25
lines changed

12 files changed

+25
-25
lines changed

google/cloud/aiplatform/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def _get_and_validate_project_location(
504504
location(str): The location of the resource noun.
505505
506506
Raises:
507-
RuntimeError if location is different from resource location
507+
RuntimeError: If location is different from resource location
508508
"""
509509

510510
fields = utils.extract_fields_from_resource_name(
@@ -604,7 +604,7 @@ def _assert_gca_resource_is_available(self) -> None:
604604
"""Helper method to raise when property is not accessible.
605605
606606
Raises:
607-
RuntimeError if _gca_resource is has not been created.
607+
RuntimeError: If _gca_resource is has not been created.
608608
"""
609609
if self._gca_resource is None:
610610
raise RuntimeError(
@@ -1115,7 +1115,7 @@ def _wait_for_resource_creation(self) -> None:
11151115
job.run(sync=False, ...)
11161116
job._wait_for_resource_creation()
11171117
Raises:
1118-
RuntimeError if the resource has not been scheduled to be created.
1118+
RuntimeError: If the resource has not been scheduled to be created.
11191119
"""
11201120

11211121
# If the user calls this but didn't actually invoke an API to create
@@ -1141,7 +1141,7 @@ def _assert_gca_resource_is_available(self) -> None:
11411141
resource creation has failed asynchronously.
11421142
11431143
Raises:
1144-
RuntimeError when resource has not been created.
1144+
RuntimeError: When resource has not been created.
11451145
"""
11461146
if not getattr(self._gca_resource, "name", None):
11471147
raise RuntimeError(

google/cloud/aiplatform/datasets/_datasources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
"bq://project.dataset.table_name"
7272
7373
Raises:
74-
ValueError if source configuration is not valid.
74+
ValueError: If source configuration is not valid.
7575
"""
7676

7777
dataset_metadata = None
@@ -215,7 +215,7 @@ def create_datasource(
215215
datasource (Datasource)
216216
217217
Raises:
218-
ValueError when below scenarios happen
218+
ValueError: When below scenarios happen:
219219
- import_schema_uri is identified for creating TabularDatasource
220220
- either import_schema_uri or gcs_source is missing for creating NonTabularDatasourceImportable
221221
"""

google/cloud/aiplatform/datasets/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _validate_metadata_schema_uri(self) -> None:
9191
"""Validate the metadata_schema_uri of retrieved dataset resource.
9292
9393
Raises:
94-
ValueError if the dataset type of the retrieved dataset resource is
94+
ValueError: If the dataset type of the retrieved dataset resource is
9595
not supported by the class.
9696
"""
9797
if self._supported_metadata_schema_uris and (

google/cloud/aiplatform/explain/metadata/tf/v1/saved_model_metadata_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
signature_name) specifies multiple outputs.
5151
5252
Raises:
53-
ValueError if outputs_to_explain contains more than 1 element or
53+
ValueError: If outputs_to_explain contains more than 1 element or
5454
signature contains multiple outputs.
5555
"""
5656
if outputs_to_explain:

google/cloud/aiplatform/explain/metadata/tf/v2/saved_model_metadata_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def __init__(
4949
Any keyword arguments to be passed to tf.saved_model.save() function.
5050
5151
Raises:
52-
ValueError if outputs_to_explain contains more than 1 element.
53-
ImportError if tf is not imported.
52+
ValueError: If outputs_to_explain contains more than 1 element.
53+
ImportError: If tf is not imported.
5454
"""
5555
if outputs_to_explain and len(outputs_to_explain) > 1:
5656
raise ValueError(
@@ -91,7 +91,7 @@ def _infer_metadata_entries_from_model(
9191
Inferred input metadata and output metadata from the model.
9292
9393
Raises:
94-
ValueError if specified name is not found in signature outputs.
94+
ValueError: If specified name is not found in signature outputs.
9595
"""
9696

9797
loaded_sig = self._loaded_model.signatures[signature_name]

google/cloud/aiplatform/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ def __init__(
10491049
staging_bucket set in aiplatform.init.
10501050
10511051
Raises:
1052-
RuntimeError is not staging bucket was set using aiplatfrom.init and a staging
1052+
RuntimeError: If staging bucket was not set using aiplatform.init and a staging
10531053
bucket was not passed in.
10541054
"""
10551055

@@ -1241,7 +1241,7 @@ def from_local_script(
12411241
staging_bucket set in aiplatform.init.
12421242
12431243
Raises:
1244-
RuntimeError is not staging bucket was set using aiplatfrom.init and a staging
1244+
RuntimeError: If staging bucket was not set using aiplatform.init and a staging
12451245
bucket was not passed in.
12461246
"""
12471247

google/cloud/aiplatform/metadata/metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ def log_metrics(self, metrics: Dict[str, Union[float, int]]):
157157
metrics (Dict):
158158
Required. Metrics key/value pairs. Only flot and int are supported format for value.
159159
Raises:
160-
TypeError if value contains unsupported types.
161-
ValueError if Experiment or Run is not set.
160+
TypeError: If value contains unsupported types.
161+
ValueError: If Experiment or Run is not set.
162162
"""
163163

164164
self._validate_experiment_and_run(method_name="log_metrics")
@@ -265,7 +265,7 @@ def _validate_metrics_value_type(metrics: Dict[str, Union[float, int]]):
265265
metrics (Dict):
266266
Required. Metrics key/value pairs. Only flot and int are supported format for value.
267267
Raises:
268-
TypeError if value contains unsupported types.
268+
TypeError: If value contains unsupported types.
269269
"""
270270

271271
for key, value in metrics.items():

google/cloud/aiplatform/metadata/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def _extract_metadata_store_id(resource_name, resource_noun) -> str:
451451
metadata_store_id (str):
452452
The metadata store id for the particular resource name.
453453
Raises:
454-
ValueError if it does not exist.
454+
ValueError: If it does not exist.
455455
"""
456456
pattern = re.compile(
457457
r"^projects\/(?P<project>[\w-]+)\/locations\/(?P<location>[\w-]+)\/metadataStores\/(?P<store>[\w-]+)\/"

google/cloud/aiplatform/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def _deploy(
786786
will be executed in concurrent Future and any downstream object will
787787
be immediately returned and synced when the Future has completed.
788788
Raises:
789-
ValueError if there is not current traffic split and traffic percentage
789+
ValueError: If there is not current traffic split and traffic percentage
790790
is not 0 or 100.
791791
"""
792792
_LOGGER.log_action_start_against_resource(
@@ -2366,9 +2366,9 @@ def export_model(
23662366
Details of the completed export with output destination paths to
23672367
the artifacts or container image.
23682368
Raises:
2369-
ValueError if model does not support exporting.
2369+
ValueError: If model does not support exporting.
23702370
2371-
ValueError if invalid arguments or export formats are provided.
2371+
ValueError: If invalid arguments or export formats are provided.
23722372
"""
23732373

23742374
# Model does not support exporting

google/cloud/aiplatform/training_jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,7 +4060,7 @@ def run(
40604060
produce a Vertex AI Model.
40614061
40624062
Raises:
4063-
RuntimeError if Training job has already been run or is waiting to run.
4063+
RuntimeError: If Training job has already been run or is waiting to run.
40644064
"""
40654065

40664066
if model_display_name:
@@ -4269,7 +4269,7 @@ def _run_with_experiments(
42694269
produce a Vertex AI Model.
42704270
42714271
Raises:
4272-
RuntimeError if Training job has already been run or is waiting to run.
4272+
RuntimeError: If Training job has already been run or is waiting to run.
42734273
"""
42744274

42754275
if additional_experiments:

google/cloud/aiplatform/utils/featurestore_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def validate_and_get_entity_type_resource_ids(
4747
Tuple[str, str] - featurestore ID and entity_type ID
4848
4949
Raises:
50-
ValueError if the provided entity_type_name is not in form of a fully-qualified
50+
ValueError: If the provided entity_type_name is not in form of a fully-qualified
5151
entityType resource name nor an entity_type ID with featurestore_id passed.
5252
"""
5353
match = CompatFeaturestoreServiceClient.parse_entity_type_path(
@@ -91,7 +91,7 @@ def validate_and_get_feature_resource_ids(
9191
Tuple[str, str, str] - featurestore ID, entity_type ID, and feature ID
9292
9393
Raises:
94-
ValueError if the provided feature_name is not in form of a fully-qualified
94+
ValueError: If the provided feature_name is not in form of a fully-qualified
9595
feature resource name nor a feature ID with featurestore_id and entity_type_id passed.
9696
"""
9797

google/cloud/aiplatform/utils/tensorboard_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _parse_experiment_name(experiment_name: str) -> Dict[str, str]:
3333
Components of the experiment name.
3434
3535
Raises:
36-
ValueError if the experiment_name is invalid.
36+
ValueError: If the experiment_name is invalid.
3737
"""
3838
matched = TensorboardServiceClient.parse_tensorboard_experiment_path(
3939
experiment_name

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.github.com/googleapis/python-aiplatform/commit/f9aecd22fe08a97e45187b4d11c755ac3b9dfadd

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy