From 3bd18958cf594d13907562aa656a367f7c70c533 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Tue, 2 Jul 2024 09:04:03 +0200 Subject: [PATCH] patch: polars strict=False --- tests/test_pandas_utils/test_pandas_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_pandas_utils/test_pandas_utils.py b/tests/test_pandas_utils/test_pandas_utils.py index 720a9e8f..841a2e12 100644 --- a/tests/test_pandas_utils/test_pandas_utils.py +++ b/tests/test_pandas_utils/test_pandas_utils.py @@ -38,7 +38,11 @@ def test_add_lags_wrong_inputs(data, frame_func): add_lags(invalid_df, ["X1"], 1) -@pytest.mark.parametrize("frame_func", [pd.DataFrame, pl.DataFrame, pl.LazyFrame]) +@pytest.mark.parametrize("frame_func", [ + pd.DataFrame, + lambda data: pl.DataFrame(data, strict=False), + lambda data: pl.LazyFrame(data, strict=False) +]) def test_add_lags_correct_df(data, frame_func): test_df = frame_func(data) expected = frame_func({"X1": [1, 2], "X2": ["178", "154"], "X1-1": [0, 1]}) @@ -56,7 +60,7 @@ def test_add_lags_correct_X(test_X): assert (add_lags(test_X, [0, 1], [1, 2]) == expected).all() -@pytest.mark.parametrize("frame_func", [pd.DataFrame, pl.DataFrame]) +@pytest.mark.parametrize("frame_func", [pd.DataFrame, lambda data: pl.DataFrame(data, strict=False)]) def test_add_lagged_dataframe_columns(data, frame_func): test_df = nw.from_native(frame_func(data)) with pytest.raises(KeyError, match="The column does not exist"):