Skip to content

Commit

Permalink
Coverage of binops where one or both operands are a scalar (#15998)
Browse files Browse the repository at this point in the history
Just needed the tests here.

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #15998
  • Loading branch information
wence- authored Jun 18, 2024
1 parent 2ddbe2a commit 9bc794a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/cudf_polars/tests/expressions/test_numeric_binops.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,15 @@ def test_numeric_binop(df, binop):
q = df.select(binop(left, right))

assert_gpu_result_equal(q)


@pytest.mark.parametrize("left_scalar", [False, True])
@pytest.mark.parametrize("right_scalar", [False, True])
def test_binop_with_scalar(left_scalar, right_scalar):
df = pl.LazyFrame({"a": [1, 2, 3], "b": [5, 6, 7]})

lop = pl.lit(2) if left_scalar else pl.col("a")
rop = pl.lit(6) if right_scalar else pl.col("b")
q = df.select(lop / rop)

assert_gpu_result_equal(q)

0 comments on commit 9bc794a

Please sign in to comment.