diff --git a/tools/stats/filtering.py b/tools/stats/filtering.py index 17047b6ec6e..5d78ce4ab5a 100644 --- a/tools/stats/filtering.py +++ b/tools/stats/filtering.py @@ -12,7 +12,8 @@ AST_NODE_TYPE_WHITELIST = [ 'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq', 'Or', 'GtE', 'LtE', 'Lt', 'Gt', 'BinOp', 'Add', 'Div', 'Sub', 'Mult', 'Mod', 'Pow', 'LShift', 'GShift', 'BitAnd', 'BitOr', 'BitXor', 'UnaryOp', 'Invert', - 'Not', 'NotIn', 'In', 'Is', 'IsNot', 'List', 'Index', 'Subscript', + 'Not', 'UAdd', 'USub', 'NotIn', 'In', 'Is', 'IsNot', 'List', 'Index', + 'Subscript', # Further checks 'Name', 'Call', 'Attribute', ] @@ -73,6 +74,8 @@ def check_expression(text): True >>> check_expression("c3=='chr1' and c5>5") True + >>> check_expression("c3=='chr1' and c5>-5 and c5<+5") # Unary +/- + True >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference False >>> check_expression("c3=='chr1' and c5>5 or exec") diff --git a/tools/stats/filtering.xml b/tools/stats/filtering.xml index 1a20cf40c94..ddf43960279 100644 --- a/tools/stats/filtering.xml +++ b/tools/stats/filtering.xml @@ -1,4 +1,4 @@ - + data on any column using simple expressions operation_0335