From 10e25d95edd7a213f81340f3e3e97a2eeef7150b Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:05:44 -0800 Subject: [PATCH 1/2] Don't override to_pandas for Datelike columns --- python/cudf/cudf/core/column/datetime.py | 18 ------------------ python/cudf/cudf/core/column/timedelta.py | 16 ---------------- 2 files changed, 34 deletions(-) diff --git a/python/cudf/cudf/core/column/datetime.py b/python/cudf/cudf/core/column/datetime.py index b03b21a7aba..2096215a22c 100644 --- a/python/cudf/cudf/core/column/datetime.py +++ b/python/cudf/cudf/core/column/datetime.py @@ -313,24 +313,6 @@ def dayofyear(self) -> ColumnBase: def day_of_year(self) -> ColumnBase: return self.get_dt_field("day_of_year") - def to_pandas( - self, - *, - index: Optional[pd.Index] = None, - nullable: bool = False, - ) -> pd.Series: - if nullable: - raise NotImplementedError(f"{nullable=} is not implemented.") - # `copy=True` workaround until following issue is fixed: - # https://issues.apache.org/jira/browse/ARROW-9772 - - return pd.Series( - self.to_arrow(), - copy=True, - dtype=self.dtype, - index=index, - ) - @property def values(self): """ diff --git a/python/cudf/cudf/core/column/timedelta.py b/python/cudf/cudf/core/column/timedelta.py index b911c86fa01..ffdc15618f9 100644 --- a/python/cudf/cudf/core/column/timedelta.py +++ b/python/cudf/cudf/core/column/timedelta.py @@ -146,22 +146,6 @@ def to_arrow(self) -> pa.Array: null_count=self.null_count, ) - def to_pandas( - self, *, index: Optional[pd.Index] = None, nullable: bool = False - ) -> pd.Series: - # `copy=True` workaround until following issue is fixed: - # https://issues.apache.org/jira/browse/ARROW-9772 - - if nullable: - raise NotImplementedError(f"{nullable=} is not implemented.") - - return pd.Series( - self.to_arrow(), - copy=True, - dtype=self.dtype, - index=index, - ) - def _binaryop(self, other: ColumnBinaryOperand, op: str) -> ColumnBase: reflect, op = self._check_reflected_op(op) other = self._wrap_binop_normalization(other) From a1e4347f7bc0f9abefff8482876f6e98221e9bf1 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 16:25:36 -0800 Subject: [PATCH 2/2] re-remove datetimelike --- python/cudf/cudf/core/column/datetime.py | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/python/cudf/cudf/core/column/datetime.py b/python/cudf/cudf/core/column/datetime.py index 85f07064c97..9a5d9dcd47a 100644 --- a/python/cudf/cudf/core/column/datetime.py +++ b/python/cudf/cudf/core/column/datetime.py @@ -313,33 +313,6 @@ def dayofyear(self) -> ColumnBase: def day_of_year(self) -> ColumnBase: return self.get_dt_field("day_of_year") - def to_pandas( - self, - *, - index: Optional[pd.Index] = None, - nullable: bool = False, - arrow_type: bool = False, - ) -> pd.Series: - if arrow_type and nullable: - raise ValueError( - f"{arrow_type=} and {nullable=} cannot both be set." - ) - elif nullable: - raise NotImplementedError(f"{nullable=} is not implemented.") - elif arrow_type: - return pd.Series( - pd.arrays.ArrowExtensionArray(self.to_arrow()), index=index - ) - else: - # `copy=True` workaround until following issue is fixed: - # https://issues.apache.org/jira/browse/ARROW-9772 - return pd.Series( - self.to_arrow(), - copy=True, - dtype=self.dtype, - index=index, - ) - @property def values(self): """