geruh commented on code in PR #3293:
URL: https://github.com/apache/iceberg-python/pull/3293#discussion_r3163157694
##########
pyiceberg/expressions/visitors.py:
##########
@@ -73,6 +77,17 @@
T = TypeVar("T")
+def _from_bytes_with_promotion(field_type: PrimitiveType, b: bytes) -> Any:
Review Comment:
Should this return `L` for the literal value instead of Any?
##########
pyiceberg/expressions/visitors.py:
##########
@@ -73,6 +77,17 @@
T = TypeVar("T")
+def _from_bytes_with_promotion(field_type: PrimitiveType, b: bytes) -> Any:
+ if len(b) == 4:
Review Comment:
nit: why is this 4? maybe we should add a comment.
##########
tests/expressions/test_evaluator.py:
##########
@@ -1463,3 +1464,46 @@ def test_strict_integer_not_in(strict_data_file_schema:
Schema, strict_data_file
should_read = _StrictMetricsEvaluator(strict_data_file_schema,
NotIn("no_nulls", {"abc", "def"})).eval(strict_data_file_1)
assert not should_read, "Should not match: no_nulls field does not have
bounds"
+
+
+def test_inclusive_metrics_evaluator_with_type_promotion_crash() -> None:
Review Comment:
nit: what do you think about creating a parametrized test for each promo
branch?
--
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]