breken-ai commented on code in PR #4029:
URL: https://github.com/apache/iceberg-python/pull/4029#discussion_r4213330838
##########
tests/catalog/test_catalog_behaviors.py:
##########
@@ -1322,6 +1322,18 @@ def test_append_invalid_input_type_raises(catalog:
Catalog) -> None:
tbl.append("not an arrow object")
+def test_scan_integer_column_with_decimal_literal(catalog: Catalog) -> None:
Review Comment:
Added in c4489d7. `2.0` (and `2`, `2.00`, `-2.0`) has no fractional part, so
it still converts and filters exactly:
-
`tests/expressions/test_literals.py::test_integral_decimal_to_integral_type` is
now parametrized over `"2"`, `"2.0"`, `"2.00"`, `"-2.0"` for both `IntegerType`
and `LongType`, and checks each one becomes `LongLiteral(int(value))`.
-
`tests/catalog/test_catalog_behaviors.py::test_scan_integer_column_with_decimal_literal`
checks `x > 2.0` returns `[3, 4]` and now also `x = 2.0` returns `[2]`, on the
memory, sql and sql_without_rowcount catalogs.
The 2.0 cases pass on both `main` and this branch, as you expected. The
fractional cases (`2.5`, `2.6`, `-2.5`, `0.1`, and the `x > 2.6` scan) fail on
`main` and pass here: 11 failed / 8 passed with `main`'s `literals.py`, and 19
passed with the fix. `pytest tests/expressions
tests/catalog/test_catalog_behaviors.py`: 1307 passed. `ruff check` and `ruff
format --check` are clean.
--
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]