Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Dec 20, 2024
1 parent d67e319 commit 772f5a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions py-polars/tests/unit/operations/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
}
Expand Down
27 changes: 17 additions & 10 deletions py-polars/tests/unit/sql/test_joins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions py-polars/tests/unit/test_cse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]})
Expand Down

0 comments on commit 772f5a6

Please sign in to comment.