Skip to content

Commit

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

The id field of JobInfo is expecting a str. In aiidateam#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 committed Jul 20, 2024
1 parent b8b48dd commit d590c45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ 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 d590c45

Please sign in to comment.