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: enabling AutoML Forecasting training response to include BigQue… · googleapis/python-aiplatform@c1c2326

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform
    • training_jobs.py
  • tests/unit/aiplatform
    • test_automl_forecasting_training_jobs.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/training_jobs.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/training_jobs.py
+26-1Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,7 @@ def _run(
44184418
encryption_spec=self._model_encryption_spec,
44194419
)
44204420

4421-
return self._run_job(
4421+
new_model = self._run_job(
44224422
training_task_definition=training_task_definition,
44234423
training_task_inputs=training_task_inputs_dict,
44244424
dataset=dataset,
@@ -4430,6 +4430,14 @@ def _run(
44304430
model=model,
44314431
)
44324432

4433+
if export_evaluated_data_items:
4434+
_LOGGER.info(
4435+
"Exported examples available at:\n%s"
4436+
% self.evaluated_data_items_bigquery_uri
4437+
)
4438+
4439+
return new_model
4440+
44334441
@property
44344442
def _model_upload_fail_string(self) -> str:
44354443
"""Helper property for model upload failure."""
@@ -4438,6 +4446,23 @@ def _model_upload_fail_string(self) -> str:
44384446
"Model."
44394447
)
44404448

4449+
@property
4450+
def evaluated_data_items_bigquery_uri(self) -> Optional[str]:
4451+
"""BigQuery location of exported evaluated examples from the Training Job
4452+
Returns:
4453+
str: BigQuery uri for the exported evaluated examples if the export
4454+
feature is enabled for training.
4455+
None: If the export feature was not enabled for training.
4456+
"""
4457+
4458+
self._assert_gca_resource_is_available()
4459+
4460+
metadata = self._gca_resource.training_task_metadata
4461+
if metadata and "evaluatedDataItemsBigqueryUri" in metadata:
4462+
return metadata["evaluatedDataItemsBigqueryUri"]
4463+
4464+
return None
4465+
44414466
def _add_additional_experiments(self, additional_experiments: List[str]):
44424467
"""Add experiment flags to the training job.
44434468
Args:
Collapse file

‎tests/unit/aiplatform/test_automl_forecasting_training_jobs.py‎

Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_automl_forecasting_training_jobs.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def mock_pipeline_service_get():
151151
name=_TEST_PIPELINE_RESOURCE_NAME,
152152
state=gca_pipeline_state.PipelineState.PIPELINE_STATE_SUCCEEDED,
153153
model_to_upload=gca_model.Model(name=_TEST_MODEL_NAME),
154+
training_task_metadata={
155+
"evaluatedDataItemsBigqueryUri": _TEST_TRAINING_EXPORT_EVALUATED_DATA_ITEMS_BIGQUERY_DESTINATION_URI
156+
},
154157
)
155158
yield mock_get_training_pipeline
156159

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.