Skip to content

Commit

Permalink
TST: Apply cudf_pandas_test fixes from rapidsaigh-16595
Browse files Browse the repository at this point in the history
Co-authored-by: galipremsagar <[email protected]>
  • Loading branch information
seberg and galipremsagar committed Aug 21, 2024
1 parent 3420a8c commit caccd02
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/cudf/cudf_pandas_tests/test_cudf_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
get_calendar,
)

from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION

# Accelerated pandas has the real pandas and cudf modules as attributes
pd = xpd._fsproxy_slow
cudf = xpd._fsproxy_fast
Expand Down Expand Up @@ -611,6 +613,10 @@ def test_array_function_series_fallback(series):
tm.assert_equal(expect, got)


@pytest.mark.xfail(
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
reason="Fails in older versions of pandas",
)
def test_timedeltaproperties(series):
psr, sr = series
psr, sr = psr.astype("timedelta64[ns]"), sr.astype("timedelta64[ns]")
Expand Down Expand Up @@ -670,6 +676,10 @@ def test_maintain_container_subclasses(multiindex):
assert isinstance(got, xpd.core.indexes.frozen.FrozenList)


@pytest.mark.xfail(
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
reason="Fails in older versions of pandas due to unsupported boxcar window type",
)
def test_rolling_win_type():
pdf = pd.DataFrame(range(5))
df = xpd.DataFrame(range(5))
Expand Down Expand Up @@ -1285,6 +1295,10 @@ def max_times_two(self):
assert s.max_times_two() == 6


@pytest.mark.xfail(
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
reason="DatetimeArray.__floordiv__ missing in pandas-2.0.0",
)
def test_floordiv_array_vs_df():
xarray = xpd.Series([1, 2, 3], dtype="datetime64[ns]").array
parray = pd.Series([1, 2, 3], dtype="datetime64[ns]").array
Expand Down Expand Up @@ -1556,6 +1570,10 @@ def test_numpy_cupy_flatiter(series):
assert type(arr.flat._fsproxy_slow) == np.flatiter


@pytest.mark.xfail(
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
reason="pyarrow_numpy storage type was not supported in pandas-2.0.0",
)
def test_arrow_string_arrays():
cu_s = xpd.Series(["a", "b", "c"])
pd_s = pd.Series(["a", "b", "c"])
Expand Down
8 changes: 8 additions & 0 deletions python/cudf/cudf_pandas_tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import os
import subprocess

import pytest

from cudf.pandas import LOADED, Profiler

if not LOADED:
Expand All @@ -13,7 +15,13 @@
import numpy as np
import pandas as pd

from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION


@pytest.mark.skipif(
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
reason="function names change across versions of pandas, so making sure it only runs on latest version of pandas",
)
def test_profiler():
np.random.seed(42)
with Profiler() as profiler:
Expand Down

0 comments on commit caccd02

Please sign in to comment.