Skip to content

Commit

Permalink
Change id field passed to JobInfo from int to str (#30)
Browse files Browse the repository at this point in the history
fixes #29

The id field of JobInfo is expecting a str. In #24 when parsing JSON
output of `hq job list` the json loads will use the int for the id
parsed directly. Wrong type causes the subtle issue that when job is
waiting it not get into QUEUED state, but immediatly finished and get
nothing to parse from output.
  • Loading branch information
unkcpz authored Jul 22, 2024
1 parent b8b48dd commit 40ac153
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def _parse_joblist_output(self, retval: int, stdout: str, stderr: str) -> list:
job_info_list = []
for hq_job_dict in hq_job_info_list:
job_info = JobInfo()
job_info.job_id = hq_job_dict["id"]
job_info.job_id = str(
hq_job_dict["id"]
) # must be str, if it is a int job will not waiting
job_info.title = hq_job_dict["name"]
stats: t.List[str] = [
stat for stat, v in hq_job_dict["task_stats"].items() if v > 0
Expand Down

0 comments on commit 40ac153

Please sign in to comment.