Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/cudf_polars/cudf_polars/dsl/expressions/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,12 @@ def do_evaluate(
elif self.name is BooleanFunction.Name.Not:
(column,) = columns
return Column(
plc.unary.unary_operation(
column.obj, plc.unary.UnaryOperator.NOT, stream=df.stream
plc.unary.cast(
plc.unary.unary_operation(
column.obj, plc.unary.UnaryOperator.NOT, stream=df.stream
),
self.dtype.plc_type,
stream=df.stream,
),
dtype=self.dtype,
)
Expand Down
12 changes: 12 additions & 0 deletions python/cudf_polars/tests/test_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ def test_select_reduce():
assert_gpu_result_equal(query)


@pytest.mark.xfail(
reason=(
"Probably won't be fixed until 1.35.1 "
"https://github.com/pola-rs/polars/issues/24964"
)
)
def test_select_reduce_unary_not():
ldf = pl.LazyFrame({"c0": [1]})
query = ldf.select((~(pl.lit(1))).min().alias("literal"))
assert_gpu_result_equal(query)


def test_select_with_cse_no_agg():
df = pl.LazyFrame({"a": [1, 2, 3]})
expr = pl.col("a") + pl.col("a")
Expand Down
Loading