Skip to content

Commit f99778e

Browse files
authored
ci: fixup cudf tests (#2899)
* ci: fixup cudf tests * just skip dask tests, they probably think we are "offering vitamins when they need painkillers" anyway
1 parent 6872e2a commit f99778e

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

narwhals/_dask/expr_dt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def func(s: dx.Series, time_zone: str) -> dx.Series:
9999

100100
return self.compliant._with_callable(func, "tz_convert", time_zone=time_zone)
101101

102-
def timestamp(self, time_unit: TimeUnit) -> DaskExpr:
102+
# ignoring coverage due to https://github.com/narwhals-dev/narwhals/issues/2808.
103+
def timestamp(self, time_unit: TimeUnit) -> DaskExpr: # pragma: no cover
103104
def func(s: dx.Series, time_unit: TimeUnit) -> dx.Series:
104105
dtype = native_to_narwhals_dtype(
105106
s.dtype, self.compliant._version, Implementation.DASK

tests/expr_and_series/division_by_zero_test.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import os
4-
53
import pytest
64

75
import narwhals as nw
@@ -107,11 +105,6 @@ def test_floordiv_int_by_zero(
107105
if "polars" in str(constructor) and POLARS_VERSION < (0, 20, 7):
108106
pytest.skip(reason="bug")
109107

110-
if "polars_lazy" in str(constructor) and os.environ.get("NARWHALS_POLARS_GPU"):
111-
request.applymarker(
112-
pytest.mark.xfail(reason="https://github.com/pola-rs/polars/issues/23365")
113-
)
114-
115108
data: dict[str, list[int]] = {"a": [left]}
116109
df = nw.from_native(constructor(data))
117110
# pyarrow backend floordiv raises divide by zero error

tests/expr_and_series/dt/timestamp_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def test_timestamp_datetimes(
5151
time_unit: Literal["ns", "us", "ms"],
5252
expected: list[int | None],
5353
) -> None:
54+
if "dask" in str(constructor):
55+
pytest.skip(reason="https://github.com/narwhals-dev/narwhals/issues/2808")
5456
if any(x in str(constructor) for x in ("duckdb", "pyspark", "ibis")):
5557
request.applymarker(
5658
pytest.mark.xfail(reason="Backend timestamp conversion not yet implemented")
@@ -95,6 +97,8 @@ def test_timestamp_datetimes_tz_aware(
9597
time_unit: Literal["ns", "us", "ms"],
9698
expected: list[int | None],
9799
) -> None:
100+
if "dask" in str(constructor):
101+
pytest.skip(reason="https://github.com/narwhals-dev/narwhals/issues/2808")
98102
if any(x in str(constructor) for x in ("duckdb", "pyspark", "ibis")):
99103
request.applymarker(
100104
pytest.mark.xfail(reason="Backend timestamp conversion not yet implemented")
@@ -150,6 +154,8 @@ def test_timestamp_dates(
150154
time_unit: Literal["ns", "us", "ms"],
151155
expected: list[int | None],
152156
) -> None:
157+
if "dask" in str(constructor):
158+
pytest.skip(reason="https://github.com/narwhals-dev/narwhals/issues/2808")
153159
if any(x in str(constructor) for x in ("duckdb", "pyspark", "ibis")):
154160
request.applymarker(
155161
pytest.mark.xfail(reason="Backend timestamp conversion not yet implemented")
@@ -177,6 +183,8 @@ def test_timestamp_dates(
177183
def test_timestamp_invalid_date(
178184
request: pytest.FixtureRequest, constructor: Constructor
179185
) -> None:
186+
if "dask" in str(constructor):
187+
pytest.skip(reason="https://github.com/narwhals-dev/narwhals/issues/2808")
180188
if any(x in str(constructor) for x in ("duckdb", "pyspark", "ibis")):
181189
request.applymarker(
182190
pytest.mark.xfail(reason="Backend timestamp conversion not yet implemented")

tests/expr_and_series/name/suffix_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ def test_suffix_after_alias(constructor: Constructor) -> None:
2323
result = df.select((nw.col("foo")).alias("alias_for_foo").name.suffix(suffix))
2424
expected = {"alias_for_foo_with_suffix": [1, 2, 3]}
2525
assert_equal_data(result, expected)
26+
result = df.select(
27+
nw.col("foo").alias("bar").name.prefix("prefix_").name.suffix("_suffix")
28+
)
29+
expected = {"prefix_bar_suffix": [1, 2, 3]}
30+
assert_equal_data(result, expected)
2631

2732

2833
def test_suffix_anonymous(constructor: Constructor) -> None:

tests/modern_polars/pivot_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data
99

1010

11-
@pytest.mark.skipif(POLARS_VERSION < (1, 0), reason="requires polars 1.0+")
1211
def test_pivot(
1312
constructor_eager: ConstructorEager, request: pytest.FixtureRequest
1413
) -> None:
1514
if any(x in str(constructor_eager) for x in ("pyarrow_table", "modin")):
1615
request.applymarker(pytest.mark.xfail)
16+
if "polars" in str(constructor_eager) and POLARS_VERSION < (1, 0):
17+
pytest.skip()
1718

1819
data = {
1920
"date": [

tests/modern_polars/unpivot_test.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,20 @@
22

33
from datetime import datetime
44

5-
import pytest
6-
75
import narwhals as nw
8-
from tests.utils import PYARROW_VERSION, Constructor, assert_equal_data
9-
6+
from tests.utils import Constructor, assert_equal_data
107

11-
def test_unpivot(constructor: Constructor, request: pytest.FixtureRequest) -> None:
12-
if "cudf" in str(constructor) or (
13-
"pyarrow_table" in str(constructor) and PYARROW_VERSION < (13, 0, 0)
14-
):
15-
request.applymarker(pytest.mark.xfail)
168

9+
def test_unpivot(constructor: Constructor) -> None:
1710
data = {
1811
"date": [datetime(2020, 1, 1), datetime(2020, 1, 2), datetime(2020, 1, 3)],
1912
"aapl": [110, 100, 105],
2013
"tsla": [220, 200, 210],
2114
"msft": [330, 300, 315],
2215
"nflx": [420, 400, 440],
2316
}
24-
2517
df = nw.from_native(constructor(data))
26-
2718
result = df.unpivot(index="date", value_name="price").sort(by=["date", "variable"])
28-
2919
expected = {
3020
"date": [
3121
*[datetime(2020, 1, 1)] * 4,

0 commit comments

Comments
 (0)