Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type annotation & tidy #6027

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions cylc/flow/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def select_task_job_platforms(self):

def select_prev_instances(
self, name: str, point: str
) -> List[Tuple[int, bool, Set[int], int]]:
) -> List[Tuple[int, bool, Set[int], str]]:
"""Select task_states table info about previous instances of a task.

Flow merge results in multiple entries for the same submit number.
Expand All @@ -799,19 +799,17 @@ def select_prev_instances(
r"SELECT flow_nums,submit_num,flow_wait,status FROM %(name)s"
r" WHERE name==? AND cycle==?"
) % {"name": self.TABLE_TASK_STATES}
ret = []
for flow_nums_str, submit_num, flow_wait, status in (
self.connect().execute(stmt, (name, point,))
):
ret.append(
(
submit_num,
flow_wait == 1,
deserialise(flow_nums_str),
status
)
return [
(
submit_num,
flow_wait == 1,
deserialise(flow_nums_str),
status
)
return ret
for flow_nums_str, submit_num, flow_wait, status in (
self.connect().execute(stmt, (name, point,))
)
]

def select_latest_flow_nums(self):
"""Return a list of the most recent previous flow numbers."""
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ def _get_task_history(
# never spawned before in any flow
submit_num = 0

prev_status = TASK_STATUS_WAITING
prev_status: str = TASK_STATUS_WAITING
prev_flow_wait = False

for _snum, f_wait, old_fnums, status in info:
Expand Down
Loading