Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
assert_gpu_result_equal,
assert_ir_translation_raises,
)
from cudf_polars.testing.engine_utils import is_streaming_engine

if TYPE_CHECKING:
from collections.abc import Callable
Expand Down Expand Up @@ -82,10 +81,6 @@ def test_boolean_function_unary(
has_nans: bool,
has_nulls: bool,
) -> None:
if is_streaming_engine(engine):
pytest.skip(
"Avoiding possible segfault with cuda 12.9 builds https://github.com/rapidsai/cudf/issues/21828"
)
values: list[float | None] = [1, 2, 3, 4, 5]
if has_nans:
values[3] = float("nan")
Expand Down Expand Up @@ -185,10 +180,6 @@ def test_boolean_isbetween_decimal_float(engine: pl.GPUEngine, closed):
)
@pytest.mark.parametrize("wide", [False, True], ids=["narrow", "wide"])
def test_boolean_horizontal(engine: pl.GPUEngine, expr, has_nulls, wide):
if is_streaming_engine(engine):
pytest.skip(
"Avoiding possible segfault with cuda 12.9 builds https://github.com/rapidsai/cudf/issues/21828"
)
ldf = pl.LazyFrame(
{
"a": [False, False, False, False, False, True],
Expand Down
9 changes: 7 additions & 2 deletions python/cudf_polars/tests/expressions/test_casting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
assert_gpu_result_equal,
assert_ir_translation_raises,
)
from cudf_polars.testing.engine_utils import is_streaming_engine

_supported_dtypes = [(pl.Int8(), pl.Int64())]

Expand Down Expand Up @@ -70,8 +71,12 @@ def test_cast_strict_false_string_to_numeric(engine: pl.GPUEngine, dtype, strict
if strict:
with pytest.raises(pl.exceptions.InvalidOperationError):
query.collect()
with pytest.raises(pl.exceptions.InvalidOperationError):
query.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
if is_streaming_engine(engine):
with pytest.RaisesGroup(pl.exceptions.InvalidOperationError):
query.collect(engine=engine)
else:
with pytest.raises(pl.exceptions.InvalidOperationError):
query.collect(engine=engine)
else:
assert_gpu_result_equal(query, engine=engine)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_datetime_from_integer(engine: pl.GPUEngine, datetime_dtype, integer_dty
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect()
with pytest.raises(pl.exceptions.ComputeError):
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
q.collect(engine=engine)
else:
assert_gpu_result_equal(q, engine=engine)

Expand Down
38 changes: 23 additions & 15 deletions python/cudf_polars/tests/expressions/test_stringfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,12 @@ def test_to_datetime(
elif outcome == "collect_error":
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect()
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
if is_streaming_engine(engine):
with pytest.RaisesGroup(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)
else:
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)
else:
assert_gpu_result_equal(q, engine=engine)

Expand Down Expand Up @@ -501,13 +505,17 @@ def test_string_from_float(engine: pl.GPUEngine, request, str_from_float_data):
assert_gpu_result_equal(q, engine=engine)


def test_string_to_numeric_invalid(numeric_type):
def test_string_to_numeric_invalid(engine, numeric_type):
df = pl.LazyFrame({"a": ["a", "b", "c"]})
q = df.select(pl.col("a").cast(numeric_type))
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect()
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
if is_streaming_engine(engine):
with pytest.RaisesGroup(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)
else:
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)


@pytest.mark.parametrize("ignore_nulls", [False, True])
Expand Down Expand Up @@ -546,7 +554,7 @@ def test_string_zfill(engine: pl.GPUEngine, fill, input_strings):
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect()
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
q.collect(engine=engine)
else:
assert_gpu_result_equal(q, engine=engine)

Expand Down Expand Up @@ -584,17 +592,21 @@ def test_string_zfill_column(engine: pl.GPUEngine, fill):
if fill is not None and fill < 0:
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect()
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
q.collect(engine=engine)
Comment thread
mroeschke marked this conversation as resolved.
else:
assert_gpu_result_equal(q, engine=engine)


def test_string_zfill_forbidden_chars():
def test_string_zfill_forbidden_chars(engine: pl.GPUEngine):
ldf = pl.LazyFrame({"a": ["Café", "345", "東京", None]})
q = ldf.select(pl.col("a").str.zfill(3))
q.collect()
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=pl.GPUEngine(executor="in-memory", raise_on_fail=True))
# disallowed by libcudf
if is_streaming_engine(engine):
with pytest.RaisesGroup(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)
else:
with pytest.raises(pl.exceptions.InvalidOperationError):
q.collect(engine=engine)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -624,10 +636,6 @@ def test_string_zfill_forbidden_chars():
],
)
def test_string_pad_start(engine: pl.GPUEngine, width, char):
if is_streaming_engine(engine):
pytest.skip(
"Avoiding possible segfault with cuda 12.9 builds https://github.com/rapidsai/cudf/issues/21828"
)
df = pl.LazyFrame({"a": ["abc", "defg", "hij"]})
q = df.select(pl.col("a").str.pad_start(width, char))
assert_gpu_result_equal(q, engine=engine)
Expand Down
Loading