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

Don't override to_pandas for Datelike columns #15167

Merged
merged 8 commits into from
Mar 7, 2024
18 changes: 0 additions & 18 deletions python/cudf/cudf/core/column/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
16 changes: 0 additions & 16 deletions python/cudf/cudf/core/column/timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading