diff --git a/python/cudf_polars/tests/expressions/test_booleanfunction.py b/python/cudf_polars/tests/expressions/test_booleanfunction.py index 93a7d3ebeec..982c0f50c43 100644 --- a/python/cudf_polars/tests/expressions/test_booleanfunction.py +++ b/python/cudf_polars/tests/expressions/test_booleanfunction.py @@ -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 @@ -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") @@ -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], diff --git a/python/cudf_polars/tests/expressions/test_casting.py b/python/cudf_polars/tests/expressions/test_casting.py index 1fbc1aa1476..ebcbb271150 100644 --- a/python/cudf_polars/tests/expressions/test_casting.py +++ b/python/cudf_polars/tests/expressions/test_casting.py @@ -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())] @@ -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) diff --git a/python/cudf_polars/tests/expressions/test_datetime_basic.py b/python/cudf_polars/tests/expressions/test_datetime_basic.py index c42d1bc2515..7e4253e8f7a 100644 --- a/python/cudf_polars/tests/expressions/test_datetime_basic.py +++ b/python/cudf_polars/tests/expressions/test_datetime_basic.py @@ -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) diff --git a/python/cudf_polars/tests/expressions/test_stringfunction.py b/python/cudf_polars/tests/expressions/test_stringfunction.py index 321e6d6964e..1c51243b72d 100644 --- a/python/cudf_polars/tests/expressions/test_stringfunction.py +++ b/python/cudf_polars/tests/expressions/test_stringfunction.py @@ -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) @@ -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]) @@ -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) @@ -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) 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( @@ -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)