Skip to content

Commit 8b75549

Browse files
committed
chore: remove Boolean constants
1 parent f58595e commit 8b75549

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)*
@@ -230,12 +227,6 @@ def __init__(self, defaults=True, **kwargs):
230227
self.submission = kwargs.pop('submission')
231228
super().__init__(defaults, **kwargs)
232229

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

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

0 commit comments

Comments
 (0)