sungwy commented on code in PR #988:
URL: https://github.com/apache/iceberg-python/pull/988#discussion_r1700271363


##########
pyiceberg/expressions/literals.py:
##########
@@ -588,7 +589,7 @@ def _(self, type_var: DecimalType) -> Literal[Decimal]:
     def _(self, type_var: BooleanType) -> Literal[bool]:
         value_upper = self.value.upper()
         if value_upper in ["TRUE", "FALSE"]:
-            return BooleanLiteral(value_upper == "TRUE")
+            return BooleanLiteral(strtobool(value_upper))

Review Comment:
   Thank you! It looks like there's still one breaking test with the new 
changes:
   
   ```
   FAILED tests/expressions/test_literals.py::test_string_to_boolean_literal - 
AssertionError: assert BooleanLiteral(False) == BooleanLiteral(True)
    +  where BooleanLiteral(False) = <function StringLiteral.to at 
0x7eff9029e4d0>(BooleanType())
    +    where <function StringLiteral.to at 0x7eff9029e4d0> = 
literal('FALSE').to
    +      where literal('FALSE') = literal('FALSE')
    +    and   BooleanType() = BooleanType()
    +  and   BooleanLiteral(True) = literal(True)
   ```



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to