From 772f5a6d6ecbab05aa6a08016ccb90f197711bfc Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Fri, 20 Dec 2024 14:37:42 +0100 Subject: [PATCH] fixed tests --- py-polars/tests/unit/operations/test_join.py | 4 +-- py-polars/tests/unit/sql/test_joins.py | 27 ++++++++++++-------- py-polars/tests/unit/test_cse.py | 1 + 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/py-polars/tests/unit/operations/test_join.py b/py-polars/tests/unit/operations/test_join.py index 9a3b763b5f6f..d42258a26562 100644 --- a/py-polars/tests/unit/operations/test_join.py +++ b/py-polars/tests/unit/operations/test_join.py @@ -195,14 +195,14 @@ def test_join_lazy_frame_on_expression() -> None: def test_join() -> None: df_left = pl.DataFrame( { - "a": ["a", "b", "a", "z"], + "a": ["a", "b", "c", "z"], "b": [1, 2, 3, 4], "c": [6, 5, 4, 3], } ) df_right = pl.DataFrame( { - "a": ["b", "c", "b", "a"], + "a": ["b", "c", "d", "a"], "k": [0, 3, 9, 6], "c": [1, 0, 2, 1], } diff --git a/py-polars/tests/unit/sql/test_joins.py b/py-polars/tests/unit/sql/test_joins.py index c423fc4c45f4..fa7a4ce152f7 100644 --- a/py-polars/tests/unit/sql/test_joins.py +++ b/py-polars/tests/unit/sql/test_joins.py @@ -124,16 +124,23 @@ def test_join_inner(foods_ipc_path: Path, join_clause: str) -> None: eager=True, ) - assert out.to_dict(as_series=False) == { - "category": ["vegetables", "vegetables"], - "calories": [45, 20], - "fats_g": [0.5, 0.0], - "sugars_g": [2, 2], - "category:foods2": ["vegetables", "vegetables"], - "calories:foods2": [45, 45], - "fats_g:foods2": [0.5, 0.5], - "sugars_g:foods2": [2, 2], - } + assert_frame_equal( + out, + pl.DataFrame( + { + "category": ["vegetables", "vegetables"], + "calories": [45, 20], + "fats_g": [0.5, 0.0], + "sugars_g": [2, 2], + "category:foods2": ["vegetables", "vegetables"], + "calories:foods2": [45, 45], + "fats_g:foods2": [0.5, 0.5], + "sugars_g:foods2": [2, 2], + } + ), + check_dtypes=False, + check_row_order=False, + ) @pytest.mark.parametrize( diff --git a/py-polars/tests/unit/test_cse.py b/py-polars/tests/unit/test_cse.py index 06efd675c84f..47e60bdb0fd6 100644 --- a/py-polars/tests/unit/test_cse.py +++ b/py-polars/tests/unit/test_cse.py @@ -647,6 +647,7 @@ def test_cse_and_schema_update_projection_pd() -> None: @pytest.mark.debug +@pytest.mark.may_fail_auto_streaming def test_cse_predicate_self_join(capfd: Any, monkeypatch: Any) -> None: monkeypatch.setenv("POLARS_VERBOSE", "1") y = pl.LazyFrame({"a": [1], "b": [2], "y": [3]})