You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "pritampan (via GitHub)" <gi...@apache.org> on 2023/02/15 17:15:22 UTC

[GitHub] [iceberg] pritampan commented on a diff in pull request #6843: [Python Legacy] Convert string to boolean if the binding variable is Boolean

pritampan commented on code in PR #6843:
URL: https://github.com/apache/iceberg/pull/6843#discussion_r1107425732


##########
python_legacy/iceberg/api/expressions/literals.py:
##########
@@ -414,6 +414,8 @@ def to(self, type_var):  # noqa: C901
                     return DecimalLiteral(Decimal(str(self.value))
                                           .quantize(Decimal("." + "".join(["0" for i in range(1, type_var.scale)]) + "1"),
                                                     rounding=ROUND_HALF_UP))
+        elif type_var.type_id == TypeID.BOOLEAN and self.value.upper() in ['TRUE', 'FALSE']:

Review Comment:
   thanks @puchengy for checking ,it will by default raise the following, let me know if it works.
   `iceberg.exceptions.exceptions.ValidationException: Invalid Value for conversion to type boolean: "false1" (StringLiteral)`
   



-- 
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-unsubscribe@iceberg.apache.org

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


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