Fokko commented on code in PR #6851:
URL: https://github.com/apache/iceberg/pull/6851#discussion_r1107756577


##########
python/pyiceberg/expressions/literals.py:
##########
@@ -562,6 +562,13 @@ def _(self, type_var: DecimalType) -> Literal[Decimal]:
                 f"Could not convert {self.value} into a {type_var}, scales 
differ {type_var.scale} <> {abs(dec.as_tuple().exponent)}"
             )
 
+    @to.register(BooleanType)
+    def _(self, type_var: BooleanType) -> Literal[bool]:
+        if self.value.upper() in ['TRUE', 'FALSE']:
+            return BooleanLiteral(True if self.value.upper() == 'TRUE' else 
False)

Review Comment:
   ```suggestion
               return BooleanLiteral(self.value.upper() == '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: [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