|
13 | 13 |
|
14 | 14 | import cudf |
15 | 15 | from cudf import Index, Series |
16 | | -from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION |
| 16 | +from cudf.core._compat import ( |
| 17 | + PANDAS_CURRENT_SUPPORTED_VERSION, |
| 18 | + PANDAS_GE_220, |
| 19 | + PANDAS_VERSION, |
| 20 | +) |
17 | 21 | from cudf.core.buffer.spill_manager import get_global_manager |
18 | 22 | from cudf.testing import _utils as utils, assert_eq |
19 | 23 | from cudf.utils.dtypes import ( |
@@ -1781,6 +1785,20 @@ def test_datetime_dateoffset_binaryop( |
1781 | 1785 | reason="https://github.com/pandas-dev/pandas/issues/57448", |
1782 | 1786 | ) |
1783 | 1787 | ) |
| 1788 | + if ( |
| 1789 | + not PANDAS_GE_220 |
| 1790 | + and dtype in {"datetime64[ms]", "datetime64[s]"} |
| 1791 | + and frequency in ("microseconds", "nanoseconds") |
| 1792 | + and n_periods != 0 |
| 1793 | + ): |
| 1794 | + pytest.skip(reason="https://github.com/pandas-dev/pandas/pull/55595") |
| 1795 | + if ( |
| 1796 | + not PANDAS_GE_220 |
| 1797 | + and dtype == "datetime64[us]" |
| 1798 | + and frequency == "nanoseconds" |
| 1799 | + and n_periods != 0 |
| 1800 | + ): |
| 1801 | + pytest.skip(reason="https://github.com/pandas-dev/pandas/pull/55595") |
1784 | 1802 |
|
1785 | 1803 | date_col = [ |
1786 | 1804 | f"2000-01-01 00:00:{components}", |
@@ -1834,7 +1852,11 @@ def test_datetime_dateoffset_binaryop( |
1834 | 1852 | "ignore:Discarding nonzero nanoseconds:UserWarning" |
1835 | 1853 | ) |
1836 | 1854 | @pytest.mark.parametrize("op", [operator.add, operator.sub]) |
1837 | | -def test_datetime_dateoffset_binaryop_multiple(date_col, kwargs, op): |
| 1855 | +@pytest.mark.skipif( |
| 1856 | + PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION, |
| 1857 | + reason="Fails in older versions of pandas", |
| 1858 | +) |
| 1859 | +def test_datetime_dateoffset_binaryop_multiple(request, date_col, kwargs, op): |
1838 | 1860 | gsr = cudf.Series(date_col, dtype="datetime64[ns]") |
1839 | 1861 | psr = gsr.to_pandas() |
1840 | 1862 |
|
@@ -1873,6 +1895,21 @@ def test_datetime_dateoffset_binaryop_multiple(date_col, kwargs, op): |
1873 | 1895 | def test_datetime_dateoffset_binaryop_reflected( |
1874 | 1896 | n_periods, frequency, dtype, components |
1875 | 1897 | ): |
| 1898 | + if ( |
| 1899 | + not PANDAS_GE_220 |
| 1900 | + and dtype in {"datetime64[ms]", "datetime64[s]"} |
| 1901 | + and frequency in ("microseconds", "nanoseconds") |
| 1902 | + and n_periods != 0 |
| 1903 | + ): |
| 1904 | + pytest.skip(reason="https://github.com/pandas-dev/pandas/pull/55595") |
| 1905 | + if ( |
| 1906 | + not PANDAS_GE_220 |
| 1907 | + and dtype == "datetime64[us]" |
| 1908 | + and frequency == "nanoseconds" |
| 1909 | + and n_periods != 0 |
| 1910 | + ): |
| 1911 | + pytest.skip(reason="https://github.com/pandas-dev/pandas/pull/55595") |
| 1912 | + |
1876 | 1913 | date_col = [ |
1877 | 1914 | f"2000-01-01 00:00:{components}", |
1878 | 1915 | f"2000-01-31 00:00:{components}", |
|
0 commit comments