From 40ac1539de9634545b11271885737d51d65b462e Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 22 Jul 2024 11:25:42 +0200 Subject: [PATCH] Change `id` field passed to JobInfo from int to str (#30) 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. --- aiida_hyperqueue/scheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiida_hyperqueue/scheduler.py b/aiida_hyperqueue/scheduler.py index 7ac08b4..5523b7f 100644 --- a/aiida_hyperqueue/scheduler.py +++ b/aiida_hyperqueue/scheduler.py @@ -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