From 7393c31c4d89922e5d04ef162f39be38d01e75f5 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:44:28 -0400 Subject: [PATCH] test(backends): fix pandas and dask tests --- ibis/backends/dask/tests/conftest.py | 2 +- ibis/backends/dask/tests/test_arrays.py | 2 +- ibis/backends/pandas/tests/conftest.py | 2 +- ibis/backends/pandas/tests/test_arrays.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ibis/backends/dask/tests/conftest.py b/ibis/backends/dask/tests/conftest.py index d9cbfd2689f3b..c2e97c566e896 100644 --- a/ibis/backends/dask/tests/conftest.py +++ b/ibis/backends/dask/tests/conftest.py @@ -376,7 +376,7 @@ def batting(lahman): def sel_cols(batting): cols = batting.columns start, end = cols.index("AB"), cols.index("H") + 1 - return ["playerID", "yearID", "teamID", "G"] + cols[start:end] + return ["playerID", "yearID", "teamID", "G", *cols[start:end]] @pytest.fixture(scope="module") diff --git a/ibis/backends/dask/tests/test_arrays.py b/ibis/backends/dask/tests/test_arrays.py index 107cca5fedaa6..35dc72e1fd61b 100644 --- a/ibis/backends/dask/tests/test_arrays.py +++ b/ibis/backends/dask/tests/test_arrays.py @@ -70,7 +70,7 @@ def test_array_collect_rolling_partitioned(t, df): } ), npartitions=1, - )[expr.columns] + )[list(expr.columns)] tm.assert_frame_equal( result.compute().reset_index(drop=True), expected.compute().reset_index(drop=True), diff --git a/ibis/backends/pandas/tests/conftest.py b/ibis/backends/pandas/tests/conftest.py index 1c9f467cf03b6..578d12c363be6 100644 --- a/ibis/backends/pandas/tests/conftest.py +++ b/ibis/backends/pandas/tests/conftest.py @@ -301,7 +301,7 @@ def batting(lahman): def sel_cols(batting): cols = batting.columns start, end = cols.index("AB"), cols.index("H") + 1 - return ["playerID", "yearID", "teamID", "G"] + cols[start:end] + return ["playerID", "yearID", "teamID", "G", *cols[start:end]] @pytest.fixture(scope="module") diff --git a/ibis/backends/pandas/tests/test_arrays.py b/ibis/backends/pandas/tests/test_arrays.py index 98d1bb6fcd8df..47e7eed82c38a 100644 --- a/ibis/backends/pandas/tests/test_arrays.py +++ b/ibis/backends/pandas/tests/test_arrays.py @@ -82,7 +82,7 @@ def test_array_collect_rolling_partitioned(t, df): "plain_int64": [1, 2, 3], "collected": [[4.0], [4.0, 5.0], [5.0, 6.0]], } - )[expr.columns] + )[list(expr.columns)] tm.assert_frame_equal(result, expected)