Skip to content

Commit

Permalink
mark metric as failure if no output (#1747)
Browse files Browse the repository at this point in the history
* mark metric as failure if no output

* return NaN
  • Loading branch information
hawestra authored Nov 14, 2023
1 parent 1604d15 commit 9e4380d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: spark
name: gsq_annotation_compute_metrics
display_name: Annotation - Compute Metrics
description: Compute annotation metrics given a deployment's model data input.
version: 0.4.2
version: 0.4.3
is_deterministic: True
inputs:
annotation_histogram:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
type: aml_token
compute_metrics:
type: spark
component: azureml://registries/azureml/components/gsq_annotation_compute_metrics/versions/0.4.2
component: azureml://registries/azureml/components/gsq_annotation_compute_metrics/versions/0.4.3
inputs:
annotation_histogram:
type: mltable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def _calculate_passrate(df, metric_name):
.head()[0]
)
total = df_with_buckets.select(sum(METRIC_VALUE_COLUMN)).head()[0]
# if there are no metric value, we should mark as fail since there was probably a
# parsing error or request error that resulted in no metrics
if total == 0:
return "1"
return "NaN"
passrate = passing / total
return str(passrate)

Expand Down

0 comments on commit 9e4380d

Please sign in to comment.