Skip to content

Commit

Permalink
fix ambig state
Browse files Browse the repository at this point in the history
  • Loading branch information
jigold committed Nov 13, 2023
1 parent a34025c commit 58122fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions batch/batch/front_end/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,16 @@ def __init__(self, state: BatchState, operator: ExactMatchOperator):
def query(self) -> Tuple[str, List[Any]]:
args: List[Any]
if self.state == BatchState.OPEN:
condition = "(`state` = 'open')"
condition = "(batches.`state` = 'open')"
args = []
elif self.state == BatchState.CLOSED:
condition = "(`state` != 'open')"
condition = "(batches.`state` != 'open')"
args = []
elif self.state == BatchState.COMPLETE:
condition = "(`state` = 'complete')"
condition = "(batches.`state` = 'complete')"
args = []
elif self.state == BatchState.RUNNING:
condition = "(`state` = 'running')"
condition = "(batches.`state` = 'running')"
args = []
elif self.state == BatchState.CANCELLED:
condition = '(batches_cancelled.id IS NOT NULL)'
Expand All @@ -381,7 +381,7 @@ def query(self) -> Tuple[str, List[Any]]:
else:
assert self.state == BatchState.SUCCESS
# need complete because there might be no jobs
condition = "(`state` = 'complete' AND n_succeeded = n_jobs)"
condition = "(batches.`state` = 'complete' AND n_succeeded = n_jobs)"
args = []

if isinstance(self.operator, NotEqualExactMatchOperator):
Expand Down

0 comments on commit 58122fd

Please sign in to comment.