jackylee-ch commented on code in PR #3917:
URL: https://github.com/apache/iceberg-python/pull/3917#discussion_r3948483369
##########
pyiceberg/expressions/parser.py:
##########
@@ -121,6 +121,15 @@ def _(result: ParseResults) -> Literal[bool]:
return BooleanLiteral(False)
+# As an operand a bare boolean has to fold to AlwaysTrue/AlwaysFalse. This
needs its own
+# copy because `literal` and `literal_set` keep the raw BooleanLiteral for
`foo = true`.
+always_boolean = boolean.copy()
Review Comment:
We do mutate it: `set_parse_action` replaces in place, and
`literal`/`literal_set` hold the same element. So the copy is gone — the
existing fold now hangs off `predicate`. That is where the bug was:
`infix_notation` returns the same `Forward` parenthesised operands recurse
through, so only `(true) and x` folded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]