Skip to content

Commit

Permalink
minchoc/filteryacc: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsh committed Sep 23, 2023
1 parent 2f6954d commit 77742d5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions minchoc/filteryacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def p_expression_op(p: yacc.YaccProduction) -> None:
p[0] &= a | b
else:
db_field: str = a.children[0][0]
rhs = b.children[0][0] if isinstance(b, Q) else None
if b == 'null' or rhs == 'rhs__isnull':
if b == 'null' or (b.children[0][0] if isinstance(b, Q) else None) == 'rhs__isnull':
p[0] &= Q(**{f'{db_field}__isnull': False if op == 'ne' else True})
else: # eq
if not isinstance(b, (int, str)):
Expand Down

0 comments on commit 77742d5

Please sign in to comment.