Skip to content

Commit

Permalink
handles missing resources key
Browse files Browse the repository at this point in the history
  • Loading branch information
markjschreiber committed Aug 15, 2024
1 parent c8ecbef commit 543da73
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
11 changes: 8 additions & 3 deletions omics/cli/run_analyzer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,18 @@ def add_run_util(run, tasks):

def add_metrics(res, resources, pricing):
"""Add run/task metrics"""
metrics = res.get("metrics", {})
res["metrics"] = metrics

arn = re.split(r"[:/]", res["arn"])
rtype = arn[-2]
region = arn[3]
res["type"] = rtype

# if a run has no metrics body then we can skip the rest
if rtype == "run" and not res["metrics"]:
return

metrics = res.get("metrics", {})
res["metrics"] = metrics

if rtype == "run":
add_run_util(res, resources[1:])

Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 543da73

Please sign in to comment.