From 0d2c91b6183f921619215553f0a3a7c32842fa04 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 22 Jul 2024 11:08:12 +0200 Subject: [PATCH] Cast job_id to str to conform with type of _jobs_cache fixes #6542 --- src/aiida/engine/processes/calcjobs/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aiida/engine/processes/calcjobs/manager.py b/src/aiida/engine/processes/calcjobs/manager.py index 75b9bb6ab1..dcf855fd20 100644 --- a/src/aiida/engine/processes/calcjobs/manager.py +++ b/src/aiida/engine/processes/calcjobs/manager.py @@ -146,7 +146,7 @@ async def _update_job_info(self) -> None: else: for job_id, future in self._job_update_requests.items(): if not future.done(): - future.set_result(self._jobs_cache.get(job_id, None)) + future.set_result(self._jobs_cache.get(str(job_id), None)) finally: self._job_update_requests = {} @@ -235,13 +235,13 @@ def _get_next_update_delay(self) -> float: def _update_requests_outstanding(self) -> bool: return any(not request.done() for request in self._job_update_requests.values()) - def _get_jobs_with_scheduler(self) -> List[str]: + def _get_jobs_with_scheduler(self) -> List[Hashable]: """Get all the jobs that are currently with scheduler. :return: the list of jobs with the scheduler :rtype: list """ - return [str(job_id) for job_id, _ in self._job_update_requests.items()] + return [job_id for job_id, _ in self._job_update_requests.items()] class JobManager: