Skip to content

Commit

Permalink
workflow-state DB check: flows back-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Apr 21, 2024
1 parent 739269b commit 78d228c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cylc/flow/dbstatecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ def workflow_state_query(
stmt_args = []
stmt_wheres = []

# TODO: back compat flow_nums DB
if output:
target_table = CylcWorkflowDAO.TABLE_TASK_OUTPUTS
mask = "name, cycle, outputs, flow_nums"
mask = "name, cycle, outputs"
else:
target_table = CylcWorkflowDAO.TABLE_TASK_STATES
mask = "name, cycle, status, flow_nums"
mask = "name, cycle, status"

if not self.back_compat_mode:
mask += ", flow_nums"

stmt = dedent(rf'''
SELECT
Expand Down Expand Up @@ -222,9 +224,10 @@ def workflow_state_query(
if row[2] is None:
# status can be None in Cylc 7 DBs
continue
flow_nums = deserialise(row[3])
if flow_num is not None and flow_num not in flow_nums:
continue
if not self.back_compat_mode:
flow_nums = deserialise(row[3])
if flow_num is not None and flow_num not in flow_nums:
continue
res.append(list(row))

if output:
Expand Down Expand Up @@ -256,7 +259,7 @@ def task_state_met(
cycle: str,
status: Optional[str] = None,
output: Optional[str] = None,
flow_num: int = None
flow_num: Optional[int] = None
):
"""Return True if cycle/task has achieved status or output.
Expand Down

0 comments on commit 78d228c

Please sign in to comment.