Skip to content

Commit 13d571a

Browse files
committed
chore: remove Boolean constants
1 parent cb4f68f commit 13d571a

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

apollo/submissions/qa/query_builder.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
from arpeggio import PTNodeVisitor, visit_parse_tree
88
from arpeggio.cleanpeg import ParserPEG
9-
from sqlalchemy import (
10-
Integer, String, and_, case, false, func, null, or_, true)
9+
from sqlalchemy import Integer, String, and_, case, false, func, null, or_
1110
from sqlalchemy.dialects.postgresql import array
1211
from sqlalchemy.sql.operators import concat_op
1312

@@ -29,10 +28,8 @@
2928
name = r'[a-zA-Z_][a-zA-Z0-9_]*'
3029
lookup = "$" ("location" / "participant" / "submission") ("." / "@") name
3130
null = "NULL"
32-
true = "TRUE"
33-
false = "FALSE"
3431
factor = ("+" / "-")? (number / variable / lookup / "(" expression ")")
35-
value = null / true / false / factor
32+
value = null / factor
3633
exponent = value (("^") value)*
3734
product = exponent (("*" / "/") exponent)*
3835
sum = product (("+" / "-") product)*
@@ -231,12 +228,6 @@ def __init__(self, defaults=True, **kwargs):
231228
self.submission = kwargs.pop('submission')
232229
super().__init__(defaults, **kwargs)
233230

234-
def visit_false(self, node, children):
235-
return False, OperandType.BOOLEAN
236-
237-
def visit_true(self, node, children):
238-
return True, OperandType.BOOLEAN
239-
240231
def visit_variable(self, node, children):
241232
var_name = node.value
242233
if var_name not in self.form.tags:
@@ -292,12 +283,6 @@ def __init__(self, defaults=True, **kwargs):
292283
self.variables = set()
293284
super().__init__(defaults, **kwargs)
294285

295-
def visit_false(self, node, children):
296-
return false(), OperandType.BOOLEAN
297-
298-
def visit_true(self, node, children):
299-
return true(), OperandType.BOOLEAN
300-
301286
def visit_lookup(self, node, children):
302287
top_level_attr, symbol, name = children
303288
op_type = OperandType.NUMERIC

0 commit comments

Comments
 (0)