From ab3accef97cde8c153a208af20045f771d8828ca Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:12:11 +0000 Subject: [PATCH] Fix Mypy lint --- cylc/flow/task_job_mgr.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cylc/flow/task_job_mgr.py b/cylc/flow/task_job_mgr.py index 75c651536b..3c8167e2b0 100644 --- a/cylc/flow/task_job_mgr.py +++ b/cylc/flow/task_job_mgr.py @@ -44,6 +44,7 @@ Optional, Tuple, Union, + cast, ) from cylc.flow import LOG @@ -1233,8 +1234,14 @@ def _prep_submit_task_job( rtconfig['remote']['host'] = host_n try: - platform = get_platform( - rtconfig, itask.tdef.name, bad_hosts=self.bad_hosts + platform = cast( + # We know this is not None because eval_platform() or + # eval_host() called above ensure it is set or else we + # return early if the subshell is still evaluating. + 'dict', + get_platform( + rtconfig, itask.tdef.name, bad_hosts=self.bad_hosts + ), ) except PlatformLookupError as exc: itask.waiting_on_job_prep = False