diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 4fad893f768..aa95e228e12 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -60,7 +60,7 @@ dependencies: - nvcomp==2.6.1 - nvtx>=0.2.1 - packaging -- pandas>=1.3,<1.6.0dev0 +- pandas>=1.3,<2.1.0dev0 - pandoc - pip - pre-commit diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index 1a4abe64b95..0aae75f69ce 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -58,7 +58,7 @@ dependencies: - nvcomp==2.6.1 - nvtx>=0.2.1 - packaging -- pandas>=1.3,<1.6.0dev0 +- pandas>=1.3,<2.1.0dev0 - pandoc - pip - pre-commit diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 612d2b177f6..64e918ab973 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -76,7 +76,7 @@ requirements: - {{ pin_compatible('protobuf', min_pin='x.x', max_pin='x') }} - python - typing_extensions >=4.0.0 - - pandas >=1.3,<1.6.0dev0 + - pandas >=1.3,<2.1.0dev0 - cupy >=12.0.0 - numba >=0.57 - numpy >=1.21 diff --git a/dependencies.yaml b/dependencies.yaml index fc3bf498918..d692324eb55 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -413,7 +413,7 @@ dependencies: packages: - fsspec>=0.6.0 - numpy>=1.21 - - pandas>=1.3,<1.6.0dev0 + - pandas>=1.3,<2.1.0dev0 run_cudf: common: - output_types: [conda, requirements, pyproject] diff --git a/python/cudf/cudf/core/_compat.py b/python/cudf/cudf/core/_compat.py index bbcde903871..e82cc22cdf1 100644 --- a/python/cudf/cudf/core/_compat.py +++ b/python/cudf/cudf/core/_compat.py @@ -12,3 +12,4 @@ PANDAS_EQ_200 = PANDAS_VERSION == version.parse("2.0.0") PANDAS_GE_200 = PANDAS_VERSION >= version.parse("2.0.0") PANDAS_GE_210 = PANDAS_VERSION >= version.parse("2.1.0") +PANDAS_LT_203 = PANDAS_VERSION < version.parse("2.0.3") diff --git a/python/cudf/cudf/core/column/timedelta.py b/python/cudf/cudf/core/column/timedelta.py index 53cbea49ab7..cdb46490dda 100644 --- a/python/cudf/cudf/core/column/timedelta.py +++ b/python/cudf/cudf/core/column/timedelta.py @@ -13,11 +13,11 @@ from cudf import _lib as libcudf from cudf._typing import ColumnBinaryOperand, DatetimeLikeScalar, Dtype from cudf.api.types import is_scalar, is_timedelta64_dtype +from cudf.core._compat import PANDAS_GE_200 from cudf.core.buffer import Buffer, acquire_spill_lock from cudf.core.column import ColumnBase, column, string from cudf.utils.dtypes import np_to_pa_dtype from cudf.utils.utils import _fillna_natwise -from cudf.core._compat import PANDAS_GE_200 _dtype_to_format_conversion = { "timedelta64[ns]": "%D days %H:%M:%S", diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 3a856ad0516..afae67ed160 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -57,6 +57,7 @@ is_struct_dtype, ) from cudf.core import column, df_protocol, indexing_utils, reshape +from cudf.core._compat import PANDAS_GE_200 from cudf.core.abc import Serializable from cudf.core.column import ( CategoricalColumn, @@ -99,7 +100,6 @@ _cudf_nvtx_annotate, _external_only_api, ) -from cudf.core._compat import PANDAS_GE_200 _cupy_nan_methods_map = { "min": "nanmin", diff --git a/python/cudf/cudf/core/index.py b/python/cudf/cudf/core/index.py index 297ac21fb7e..b40fb631d1d 100644 --- a/python/cudf/cudf/core/index.py +++ b/python/cudf/cudf/core/index.py @@ -7,14 +7,7 @@ import warnings from functools import cache, cached_property from numbers import Number -from typing import ( - Any, - List, - MutableMapping, - Optional, - Tuple, - Union, -) +from typing import Any, List, MutableMapping, Optional, Tuple, Union import cupy import numpy as np diff --git a/python/cudf/cudf/tests/test_api_types.py b/python/cudf/cudf/tests/test_api_types.py index ae3d232e542..8681aea37ec 100644 --- a/python/cudf/cudf/tests/test_api_types.py +++ b/python/cudf/cudf/tests/test_api_types.py @@ -6,8 +6,8 @@ from pandas.api import types as pd_types import cudf -from cudf.core._compat import PANDAS_GE_200 from cudf.api import types +from cudf.core._compat import PANDAS_GE_200 @pytest.mark.parametrize( diff --git a/python/cudf/cudf/tests/test_column_accessor.py b/python/cudf/cudf/tests/test_column_accessor.py index b983c2dcab9..a9cb4114816 100644 --- a/python/cudf/cudf/tests/test_column_accessor.py +++ b/python/cudf/cudf/tests/test_column_accessor.py @@ -5,9 +5,9 @@ import pytest import cudf +from cudf.core._compat import PANDAS_GE_200 from cudf.core.column_accessor import ColumnAccessor from cudf.testing._utils import assert_eq -from cudf.core._compat import PANDAS_GE_200 simple_test_data = [ {}, diff --git a/python/cudf/cudf/tests/test_concat.py b/python/cudf/cudf/tests/test_concat.py index 925a522399d..4116234a543 100644 --- a/python/cudf/cudf/tests/test_concat.py +++ b/python/cudf/cudf/tests/test_concat.py @@ -8,7 +8,7 @@ import cudf as gd from cudf.api.types import is_categorical_dtype -from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140, PANDAS_GE_200 +from cudf.core._compat import PANDAS_GE_150, PANDAS_GE_200, PANDAS_LT_140 from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype from cudf.testing._utils import ( assert_eq, diff --git a/python/cudf/cudf/tests/test_csv.py b/python/cudf/cudf/tests/test_csv.py index 31a73c62cc3..dc91e5138fb 100644 --- a/python/cudf/cudf/tests/test_csv.py +++ b/python/cudf/cudf/tests/test_csv.py @@ -16,7 +16,7 @@ import cudf from cudf import read_csv -from cudf.core._compat import PANDAS_LT_140, PANDAS_GE_200 +from cudf.core._compat import PANDAS_GE_200, PANDAS_LT_140 from cudf.testing._utils import assert_eq, assert_exceptions_equal diff --git a/python/cudf/cudf/tests/test_dataframe.py b/python/cudf/cudf/tests/test_dataframe.py index 47e83326856..6dfa65a1608 100644 --- a/python/cudf/cudf/tests/test_dataframe.py +++ b/python/cudf/cudf/tests/test_dataframe.py @@ -26,6 +26,7 @@ PANDAS_GE_150, PANDAS_GE_200, PANDAS_LT_140, + PANDAS_LT_203, ) from cudf.core.buffer.spill_manager import get_global_manager from cudf.core.column import column @@ -8406,6 +8407,7 @@ def test_dataframe_mode(request, df, numeric_only, dropna): request.applymarker( pytest.mark.xfail( condition=PANDAS_GE_200 + and PANDAS_LT_203 and numeric_only is False and "b" in df.columns and df["b"].dtype == np.dtype("timedelta64[s]"), diff --git a/python/cudf/cudf/tests/test_datetime.py b/python/cudf/cudf/tests/test_datetime.py index 68c9f725aa7..5b2f9d81cc8 100644 --- a/python/cudf/cudf/tests/test_datetime.py +++ b/python/cudf/cudf/tests/test_datetime.py @@ -2,6 +2,7 @@ import datetime import operator +import warnings import cupy as cp import numpy as np @@ -10,10 +11,9 @@ import pytest import cudf -import warnings import cudf.testing.dataset_generator as dataset_generator from cudf import DataFrame, Series -from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140, PANDAS_EQ_200 +from cudf.core._compat import PANDAS_EQ_200, PANDAS_GE_150, PANDAS_LT_140 from cudf.core.index import DatetimeIndex from cudf.testing._utils import ( DATETIME_TYPES, diff --git a/python/cudf/cudf/tests/test_groupby.py b/python/cudf/cudf/tests/test_groupby.py index 087973e273e..58aa4ebfd76 100644 --- a/python/cudf/cudf/tests/test_groupby.py +++ b/python/cudf/cudf/tests/test_groupby.py @@ -21,9 +21,9 @@ from cudf import DataFrame, Series from cudf.core._compat import ( PANDAS_GE_150, - PANDAS_LT_140, PANDAS_GE_200, PANDAS_GE_210, + PANDAS_LT_140, ) from cudf.core.udf.groupby_typing import SUPPORTED_GROUPBY_NUMPY_TYPES from cudf.core.udf.utils import precompiled diff --git a/python/cudf/cudf/tests/test_index.py b/python/cudf/cudf/tests/test_index.py index 6c6a8329663..b9aebdf5cd8 100644 --- a/python/cudf/cudf/tests/test_index.py +++ b/python/cudf/cudf/tests/test_index.py @@ -2891,7 +2891,7 @@ def test_rangeindex_join_user_option(default_integer_bitwidth): actual = idx1.join(idx2, how="inner", sort=True) expected = idx1.to_pandas().join(idx2.to_pandas(), how="inner", sort=True) assert actual.dtype == cudf.dtype(f"int{default_integer_bitwidth}") - assert_eq(expected, actual) + assert_eq(expected, actual, exact=False) def test_rangeindex_where_user_option(default_integer_bitwidth): diff --git a/python/cudf/cudf/tests/test_joining.py b/python/cudf/cudf/tests/test_joining.py index 0b1354fa125..ce98db8e034 100644 --- a/python/cudf/cudf/tests/test_joining.py +++ b/python/cudf/cudf/tests/test_joining.py @@ -7,6 +7,7 @@ import pytest import cudf +from cudf.core._compat import PANDAS_GE_200 from cudf.core.dtypes import CategoricalDtype, Decimal64Dtype, Decimal128Dtype from cudf.testing._utils import ( INTEGER_TYPES, @@ -15,7 +16,6 @@ assert_exceptions_equal, expect_warning_if, ) -from cudf.core._compat import PANDAS_GE_200 _JOIN_TYPES = ("left", "inner", "outer", "right", "leftanti", "leftsemi") @@ -183,7 +183,9 @@ def test_dataframe_join_suffix(): assert_eq(expect.index.values, got.index.values) got_sorted = got.sort_values(by=list(got.columns), axis=0) + expect.index.name = None expect_sorted = expect.sort_values(by=list(expect.columns), axis=0) + for k in expect_sorted.columns: _check_series(expect_sorted[k].fillna(-1), got_sorted[k].fillna(-1)) diff --git a/python/cudf/cudf/tests/test_monotonic.py b/python/cudf/cudf/tests/test_monotonic.py index 6cb877fc293..fc90e6016d4 100644 --- a/python/cudf/cudf/tests/test_monotonic.py +++ b/python/cudf/cudf/tests/test_monotonic.py @@ -9,12 +9,13 @@ import pytest import cudf -from cudf import MultiIndex, Series -from cudf.core.index import ( +from cudf import ( CategoricalIndex, DatetimeIndex, Index, + MultiIndex, RangeIndex, + Series, ) from cudf.testing._utils import assert_eq diff --git a/python/cudf/cudf/tests/test_orc.py b/python/cudf/cudf/tests/test_orc.py index ed652753636..1f37c9fc3f5 100644 --- a/python/cudf/cudf/tests/test_orc.py +++ b/python/cudf/cudf/tests/test_orc.py @@ -15,6 +15,7 @@ import pytest import cudf +from cudf.core._compat import PANDAS_GE_200 from cudf.io.orc import ORCWriter from cudf.testing import assert_frame_equal from cudf.testing._utils import ( @@ -23,7 +24,6 @@ gen_rand_series, supported_numpy_dtypes, ) -from cudf.core._compat import PANDAS_GE_200 # Removal of these deprecated features is no longer imminent. They will not be # removed until a suitable alternative has been implemented. As a result, we diff --git a/python/cudf/cudf/tests/test_parquet.py b/python/cudf/cudf/tests/test_parquet.py index 6890db15761..d59e9f9ba73 100644 --- a/python/cudf/cudf/tests/test_parquet.py +++ b/python/cudf/cudf/tests/test_parquet.py @@ -20,7 +20,7 @@ from pyarrow import fs as pa_fs, parquet as pq import cudf -from cudf.core._compat import PANDAS_LT_153, PANDAS_GE_200 +from cudf.core._compat import PANDAS_GE_200, PANDAS_LT_153 from cudf.io.parquet import ( ParquetDatasetWriter, ParquetWriter, diff --git a/python/cudf/cudf/tests/test_resampling.py b/python/cudf/cudf/tests/test_resampling.py index ce5b05adff1..83d1a7f0ee7 100644 --- a/python/cudf/cudf/tests/test_resampling.py +++ b/python/cudf/cudf/tests/test_resampling.py @@ -5,8 +5,8 @@ import pytest import cudf -from cudf.testing._utils import assert_eq from cudf.core._compat import PANDAS_GE_200 +from cudf.testing._utils import assert_eq def assert_resample_results_equal(lhs, rhs, **kwargs): diff --git a/python/cudf/cudf/tests/test_rolling.py b/python/cudf/cudf/tests/test_rolling.py index a4c41136b1b..13a4cc289e4 100644 --- a/python/cudf/cudf/tests/test_rolling.py +++ b/python/cudf/cudf/tests/test_rolling.py @@ -8,7 +8,7 @@ import pytest import cudf -from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140, PANDAS_GE_200 +from cudf.core._compat import PANDAS_GE_150, PANDAS_GE_200, PANDAS_LT_140 from cudf.testing._utils import _create_pandas_series, assert_eq from cudf.testing.dataset_generator import rand_dataframe diff --git a/python/cudf/cudf/tests/test_series.py b/python/cudf/cudf/tests/test_series.py index 96431f380e1..36dedee4b97 100644 --- a/python/cudf/cudf/tests/test_series.py +++ b/python/cudf/cudf/tests/test_series.py @@ -13,6 +13,7 @@ import pytest import cudf +from cudf.api.extensions import no_default from cudf.core._compat import PANDAS_LT_140 from cudf.testing._utils import ( NUMERIC_TYPES, @@ -23,7 +24,6 @@ expect_warning_if, gen_rand, ) -from cudf.api.extensions import no_default def _series_na_data(): diff --git a/python/cudf/cudf/tests/test_timedelta.py b/python/cudf/cudf/tests/test_timedelta.py index 7f501373be3..901ad461ee8 100644 --- a/python/cudf/cudf/tests/test_timedelta.py +++ b/python/cudf/cudf/tests/test_timedelta.py @@ -9,9 +9,9 @@ import pytest import cudf +from cudf.core._compat import PANDAS_GE_200 from cudf.testing import _utils as utils from cudf.testing._utils import assert_eq, assert_exceptions_equal -from cudf.core._compat import PANDAS_GE_200 _TIMEDELTA_DATA = [ [1000000, 200000, 3000000], diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index 5cd63893844..74535a7943f 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "numpy>=1.21", "nvtx>=0.2.1", "packaging", - "pandas>=1.3,<1.6.0dev0", + "pandas>=1.3,<2.1.0dev0", "protobuf>=4.21,<5", "ptxcompiler", "pyarrow==12.*", diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index 2b43a686d54..206308d55d5 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "distributed>=2023.5.1", "fsspec>=0.6.0", "numpy>=1.21", - "pandas>=1.3,<1.6.0dev0", + "pandas>=1.3,<2.1.0dev0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ "Intended Audience :: Developers",