Skip to content

Commit

Permalink
Accepting metric without flag set
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstretenowich committed Nov 29, 2023
1 parent 8674a8a commit 0f80cf8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions project_tracking/db_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,14 @@ def ingest_run_processing(project_id: str, ingest_data, session=None):
metric_deliverable = metric_json[vb.METRIC_DELIVERABLE]
else:
metric_deliverable = False
if vb.METRIC_FLAG in metric_json:
metric_flag = FlagEnum(metric_json[vb.METRIC_FLAG])
else:
metric_flag = None
Metric(
name=metric_json[vb.METRIC_NAME],
value=metric_json[vb.METRIC_VALUE],
flag=FlagEnum(metric_json[vb.METRIC_FLAG]),
flag=metric_flag,
deliverable=metric_deliverable,
job=job,
readsets=[readset]
Expand Down Expand Up @@ -1150,10 +1154,14 @@ def ingest_genpipes(project_id: str, ingest_data, session=None):
metric_deliverable = metric_json[vb.METRIC_DELIVERABLE]
else:
metric_deliverable = False
if vb.METRIC_FLAG in metric_json:
metric_flag = FlagEnum(metric_json[vb.METRIC_FLAG])
else:
metric_flag = None
Metric(
name=metric_json[vb.METRIC_NAME],
value=metric_json[vb.METRIC_VALUE],
flag=FlagEnum(metric_json[vb.METRIC_FLAG]),
flag=metric_flag,
deliverable=metric_deliverable,
job=job,
readsets=[readset]
Expand Down

0 comments on commit 0f80cf8

Please sign in to comment.