Skip to content

Commit

Permalink
test: update cuDF tests (#1196)
Browse files Browse the repository at this point in the history
* unxfail test_to_dummies_drop_first

* xfail timezone tests for cuDF

* fix typo
  • Loading branch information
LiamConnors authored Oct 17, 2024
1 parent 3a167ab commit c19be3b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
20 changes: 14 additions & 6 deletions tests/expr_and_series/convert_time_zone_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
def test_convert_time_zone(
constructor: Constructor, request: pytest.FixtureRequest
) -> None:
if (any(x in str(constructor) for x in ("pyarrow", "modin")) and is_windows()) or (
"pandas_pyarrow" in str(constructor) and parse_version(pd.__version__) < (2, 1)
if (
(any(x in str(constructor) for x in ("pyarrow", "modin")) and is_windows())
or (
"pandas_pyarrow" in str(constructor)
and parse_version(pd.__version__) < (2, 1)
)
or ("cudf" in str(constructor))
):
request.applymarker(pytest.mark.xfail)
data = {
Expand All @@ -41,10 +46,12 @@ def test_convert_time_zone_series(
constructor_eager: Any, request: pytest.FixtureRequest
) -> None:
if (
any(x in str(constructor_eager) for x in ("pyarrow", "modin")) and is_windows()
) or (
"pandas_pyarrow" in str(constructor_eager)
and parse_version(pd.__version__) < (2, 1)
(any(x in str(constructor_eager) for x in ("pyarrow", "modin")) and is_windows())
or (
"pandas_pyarrow" in str(constructor_eager)
and parse_version(pd.__version__) < (2, 1)
)
or ("cudf" in str(constructor_eager))
):
request.applymarker(pytest.mark.xfail)
data = {
Expand Down Expand Up @@ -73,6 +80,7 @@ def test_convert_time_zone_from_none(
and parse_version(pd.__version__) < (2, 1)
)
or ("pyarrow_table" in str(constructor) and parse_version(pa.__version__) < (12,))
or ("cudf" in str(constructor))
):
request.applymarker(pytest.mark.xfail)
if "polars" in str(constructor) and parse_version(pl.__version__) < (0, 20, 7):
Expand Down
2 changes: 2 additions & 0 deletions tests/expr_and_series/replace_time_zone_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_replace_time_zone(
(any(x in str(constructor) for x in ("pyarrow", "modin")) and is_windows())
or ("pandas_pyarrow" in str(constructor) and parse_version(pd.__version__) < (2,))
or ("pyarrow_table" in str(constructor) and parse_version(pa.__version__) < (12,))
or ("cudf" in str(constructor))
):
request.applymarker(pytest.mark.xfail)
data = {
Expand Down Expand Up @@ -76,6 +77,7 @@ def test_replace_time_zone_series(
"pyarrow_table" in str(constructor_eager)
and parse_version(pa.__version__) < (12,)
)
or ("cudf" in str(constructor_eager))
):
request.applymarker(pytest.mark.xfail)
data = {
Expand Down
6 changes: 1 addition & 5 deletions tests/series_only/to_dummy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ def test_to_dummies(constructor_eager: Any, sep: str) -> None:


@pytest.mark.parametrize("sep", ["_", "-"])
def test_to_dummies_drop_first(
request: pytest.FixtureRequest, constructor_eager: Any, sep: str
) -> None:
if "cudf" in str(constructor_eager):
request.applymarker(pytest.mark.xfail)
def test_to_dummies_drop_first(constructor_eager: Any, sep: str) -> None:
s = nw.from_native(constructor_eager({"a": data}), eager_only=True)["a"].alias("a")
result = s.to_dummies(drop_first=True, separator=sep)
expected = {f"a{sep}2": [0, 1, 0], f"a{sep}3": [0, 0, 1]}
Expand Down

0 comments on commit c19be3b

Please sign in to comment.