GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: reraise exceptions from API calls · googleapis/python-aiplatform@d72bc83

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform
    • datasets
      • column_names_dataset.py
    • initializer.py
    • models.py
    • tensorboard
      • uploader.py
      • uploader_main.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/datasets/column_names_dataset.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/datasets/column_names_dataset.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _retrieve_gcs_source_columns(
157157
"There was a problem extracting the headers from the CSV file at '{}': {}".format(
158158
gcs_csv_file_path, err
159159
)
160-
)
160+
) from err
161161
finally:
162162
logger.removeFilter(logging_warning_filter)
163163

Collapse file

‎google/cloud/aiplatform/initializer.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/initializer.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ def project(self) -> str:
212212

213213
try:
214214
_, project_id = google.auth.default()
215-
except GoogleAuthError:
216-
raise GoogleAuthError(project_not_found_exception_str)
215+
except GoogleAuthError as exc:
216+
raise GoogleAuthError(project_not_found_exception_str) from exc
217217

218218
if not project_id:
219219
raise ValueError(project_not_found_exception_str)
Collapse file

‎google/cloud/aiplatform/models.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/models.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,10 +2508,10 @@ def training_job(self) -> Optional["aiplatform.training_jobs._TrainingJob"]:
25082508
location=self.location,
25092509
credentials=self.credentials,
25102510
)
2511-
except api_exceptions.NotFound:
2511+
except api_exceptions.NotFound as exc:
25122512
raise api_exceptions.NotFound(
25132513
f"The training job used to create this model could not be found: {job_name}"
2514-
)
2514+
) from exc
25152515

25162516
@property
25172517
def container_spec(self) -> Optional[model_v1.ModelContainerSpec]:
Collapse file

‎google/cloud/aiplatform/tensorboard/uploader.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/tensorboard/uploader.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def flush(self):
873873
hasattr(e, "code")
874874
and getattr(e, "code")() == grpc.StatusCode.NOT_FOUND
875875
):
876-
raise ExperimentNotFoundError()
876+
raise ExperimentNotFoundError() from e
877877
logger.error("Upload call failed with error %s", e)
878878

879879
self._new_request()
@@ -1161,7 +1161,7 @@ def _validate(
11611161
"a bug in the process that wrote the tensor.\n\n"
11621162
"The tensor has tag '%s' and is at step %d and wall_time %.6f.\n\n"
11631163
"Original error:\n%s" % (value.tag, event.step, event.wall_time, error)
1164-
)
1164+
) from error
11651165
return True
11661166

11671167

Collapse file

‎google/cloud/aiplatform/tensorboard/uploader_main.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/tensorboard/uploader_main.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def main(argv):
110110
raise app.UsageError(
111111
"Tensorboard resource %s not found" % FLAGS.tensorboard_resource_name,
112112
exitcode=0,
113-
)
113+
) from rpc_error
114114
raise
115115

116116
if tensorboard.blob_storage_path_prefix:

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.