Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pandas pinnings & make style fixes #13599

Closed
Closed
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions python/cudf/cudf/core/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/column/timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -99,7 +100,6 @@
_cudf_nvtx_annotate,
_external_only_api,
)
from cudf.core._compat import PANDAS_GE_200

_cupy_nan_methods_map = {
"min": "nanmin",
Expand Down
9 changes: 1 addition & 8 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_column_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{},
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 2 additions & 0 deletions python/cudf/cudf/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]"),
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import datetime
import operator
import warnings

import cupy as cp
import numpy as np
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the exactness not possible because the bitwidth might be different?



def test_rangeindex_where_user_option(default_integer_bitwidth):
Expand Down
4 changes: 3 additions & 1 deletion python/cudf/cudf/tests/test_joining.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")

Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an API-mismatch in sort_values for us?

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))

Expand Down
5 changes: 3 additions & 2 deletions python/cudf/cudf/tests/test_monotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -23,7 +24,6 @@
expect_warning_if,
gen_rand,
)
from cudf.api.extensions import no_default


def _series_na_data():
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand Down
2 changes: 1 addition & 1 deletion python/dask_cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading