Skip to content

Commit

Permalink
Update lib/dynamo/dynamo/jobs.py
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Herrmann <[email protected]>
  • Loading branch information
williamh890 and jtherrmann authored Mar 10, 2025
1 parent 84a4bf5 commit c1e3fe5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/dynamo/dynamo/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,25 @@ def _get_cost_parameter_value(job: dict, cost_parameter: str) -> str:
parameter_value = job['job_parameters'][cost_parameter]

if isinstance(parameter_value, str):
return parameter_value
cost_parameter_value = parameter_value

elif isinstance(parameter_value, int):
return str(parameter_value)
cost_parameter_value = str(parameter_value)

elif isinstance(parameter_value, float):
return str(int(parameter_value))
cost_parameter_value = str(int(parameter_value))

elif isinstance(parameter_value, list):
return str(len(parameter_value))
cost_parameter_value = str(len(parameter_value))

else:
raise ValueError(
f'Cost parameter {cost_parameter} for job type {job["job_type"]} has '
'unsupported type {type(parameter_value)}'
f'unsupported type {type(parameter_value)}'
)

return cost_parameter_value


def query_jobs(
user: str,
Expand Down

0 comments on commit c1e3fe5

Please sign in to comment.