Skip to content

Commit 1569057

Browse files
nick863Nikolay Rovinskiy
and
Nikolay Rovinskiy
authored
Check for failed pipeline. (Azure#2013)
Co-authored-by: Nikolay Rovinskiy <[email protected]>
1 parent af35d27 commit 1569057

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

sdk/python/jobs/pipelines/1h_automl_in_pipeline/automl-forecasting-in-pipeline/automl-forecasting-in-pipeline.ipynb

+10-16
Original file line numberDiff line numberDiff line change
@@ -488,18 +488,9 @@
488488
},
489489
{
490490
"cell_type": "code",
491-
"execution_count": 18,
492-
"metadata": {},
493-
"outputs": [
494-
{
495-
"name": "stdout",
496-
"output_type": "stream",
497-
"text": [
498-
"[2022-10-28 05:20:59Z] Completing processing run id 82ef9376-93e3-4678-bc8c-d3421870363c.\n",
499-
"[2022-10-28 05:21:00Z] Submitting 1 runs, first five are: c1f85bd1:0bd3ed1c-ebb5-4f5f-a0bc-18500d18e26e\n"
500-
]
501-
}
502-
],
491+
"execution_count": null,
492+
"metadata": {},
493+
"outputs": [],
503494
"source": [
504495
"# Wait until the job completes\n",
505496
"ml_client.jobs.stream(pipeline_job.name)"
@@ -617,6 +608,7 @@
617608
"outputs": [],
618609
"source": [
619610
"import re\n",
611+
"from mlflow.entities import RunStatus\n",
620612
"\n",
621613
"parent_run_id = ml_model[\"run_id\"][: ml_model[\"run_id\"].index(\"_\")]\n",
622614
"child_run_regex = re.compile(r\"[^_]+_\\d+$\")\n",
@@ -625,10 +617,12 @@
625617
" lambda x: child_run_regex.match(x.name),\n",
626618
" ml_client.jobs.list(parent_job_name=parent_run_id),\n",
627619
"):\n",
628-
" print(\n",
629-
" f\"{child_run.name}: \"\n",
630-
" f'{mlflow_client.get_run(child_run.name).data.metrics[\"normalized_root_mean_squared_error\"]}'\n",
631-
" )"
620+
" mlflow_child_run = mlflow_client.get_run(child_run.name)\n",
621+
" if RunStatus.from_string(mlflow_child_run.info.status) == RunStatus.FINISHED:\n",
622+
" print(\n",
623+
" f\"{child_run.name}: \"\n",
624+
" f'{mlflow_child_run.data.metrics[\"normalized_root_mean_squared_error\"]}'\n",
625+
" )"
632626
]
633627
},
634628
{

0 commit comments

Comments
 (0)