From e093b698a28d93dc590550110cecf5ce169a8b56 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Wed, 23 Oct 2024 13:32:55 -0800 Subject: [PATCH] test: add test that `/` performs true division, not floor division --- ibis/backends/tests/test_numeric.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ibis/backends/tests/test_numeric.py b/ibis/backends/tests/test_numeric.py index a40408c7631b3..1943c25c25943 100644 --- a/ibis/backends/tests/test_numeric.py +++ b/ibis/backends/tests/test_numeric.py @@ -1092,6 +1092,13 @@ def test_binary_arithmetic_operations(backend, alltypes, df, op): backend.assert_series_equal(result, expected, check_exact=False) +@pytest.mark.notimpl("flink", raises=AssertionError, reason="Flink does floor division") +def test_integer_truediv(con): + expr = 1 / ibis.literal(2) + result = con.execute(expr) + assert result == 0.5 + + def test_mod(backend, alltypes, df): expr = operator.mod(alltypes.smallint_col, alltypes.smallint_col + 1).name("tmp")