Yshuro opened a new pull request, #4427:
URL: https://github.com/apache/iceberg-python/pull/4427

   ### Summary
   Implements explicit Python truthiness semantics for BooleanExpression 
classes as discussed in #3543:
   - AlwaysTrue.__bool__ evaluates to True.
   - AlwaysFalse.__bool__ evaluates to False.
   - Non-constant BooleanExpression.__bool__ raises TypeError to prevent 
accidental logic errors when using Python control flow / logical operators (
   ot, nd, or) instead of bitwise expression operators (~, &, |).
   
   ### Changes
   - pyiceberg/expressions/__init__.py: Implement __bool__ on BooleanExpression 
(raises TypeError), AlwaysTrue (returns True), and AlwaysFalse (returns False).
   -    ests/expressions/test_expressions.py: Add unit tests for truthiness 
evaluation and type error assertions.
   
   Closes #3543
   


-- 
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]

Reply via email to