From 6b7ceb886f82392ef6907ae66d3b5ab350805368 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 12 Sep 2024 07:22:11 -0400 Subject: [PATCH] test(polars): unxfail polars timestamp truncation tests by casting the expected result dtype (#10040) --- ibis/backends/tests/test_temporal.py | 52 ++++------------------------ 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/ibis/backends/tests/test_temporal.py b/ibis/backends/tests/test_temporal.py index ee9c3931151c..425190c996dd 100644 --- a/ibis/backends/tests/test_temporal.py +++ b/ibis/backends/tests/test_temporal.py @@ -275,62 +275,22 @@ def test_timestamp_extract_week_of_year(backend, alltypes, df): @pytest.mark.parametrize( ("ibis_unit", "pandas_unit"), [ - param( - "Y", - "Y", - marks=[ - pytest.mark.notimpl( - ["polars"], - raises=AssertionError, - reason="numpy array are different", - ), - ], - ), - param( - "Q", - "Q", - marks=[ - pytest.mark.notimpl( - ["polars"], - raises=AssertionError, - reason="numpy array are different", - ), - ], - ), - param( - "M", - "M", - marks=[ - pytest.mark.notimpl( - ["polars"], - raises=AssertionError, - reason="numpy array are different", - ), - ], - ), - param( - "D", - "D", - marks=[ - pytest.mark.notimpl( - ["polars"], - raises=AssertionError, - reason="numpy array are different", - ), - ], - ), + param("Y", "Y", id="year"), + param("Q", "Q", id="quarter"), + param("M", "M", id="month"), param( "W", "W", marks=[ pytest.mark.notimpl(["mysql"], raises=com.UnsupportedOperationError), pytest.mark.notimpl( - ["polars", "flink"], + ["flink"], raises=AssertionError, reason="implemented, but doesn't match other backends", ), ], ), + param("D", "D"), param( "h", "h", @@ -427,7 +387,7 @@ def test_timestamp_truncate(backend, alltypes, df, ibis_unit, pandas_unit): expected = dtns.floor(pandas_unit) result = expr.execute() - expected = backend.default_series_rename(expected) + expected = backend.default_series_rename(expected).astype(result.dtype) backend.assert_series_equal(result, expected)