Skip to content

Commit

Permalink
join_where tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Oct 16, 2024
1 parent 83fa5b6 commit 4350006
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions python/cudf_polars/tests/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def right():
{
"a": [1, 4, 3, 7, None, None],
"c": [2, 3, 4, 5, 6, 7],
"d": [6, None, 7, 8, -1, 2],
}
)

Expand Down Expand Up @@ -86,3 +87,24 @@ def test_join_literal_key_unsupported(left, right, left_on, right_on):
q = left.join(right, left_on=left_on, right_on=right_on, how="inner")

assert_ir_translation_raises(q, NotImplementedError)


@pytest.mark.parametrize(
"conditions",
[
[pl.col("a") < pl.col("a_right")],
[pl.col("a_right") <= pl.col("a") * 2],
[pl.col("b") * 2 > pl.col("a_right"), pl.col("a") == pl.col("c_right")],
[pl.col("b") * 2 <= pl.col("a_right"), pl.col("a") < pl.col("c_right")],
pytest.param(
[pl.col("b") <= pl.col("a_right") * 7, pl.col("a") < pl.col("d") * 2],
marks=pytest.mark.xfail(
reason="https://github.com/pola-rs/polars/issues/19119"
),
),
],
)
def test_join_where(left, right, conditions):
q = left.join_where(right, *conditions)

assert_gpu_result_equal(q, check_row_order=False)

0 comments on commit 4350006

Please sign in to comment.