Skip to content

Commit d7a7d12

Browse files
Remove pandas compatibility gating for dtypes in timdelta column (rapidsai#21258)
Remove pandas compatibility gating for dtypes in timdelta column Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Matthew Roeschke (https://github.com/mroeschke) URL: rapidsai#21258
1 parent 2295258 commit d7a7d12

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

python/cudf/cudf/core/column/timedelta.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,8 @@ def _validate_args(
8787
cls, plc_column: plc.Column, dtype: np.dtype
8888
) -> tuple[plc.Column, np.dtype]:
8989
plc_column, dtype = super()._validate_args(plc_column, dtype)
90-
if cudf.get_option("mode.pandas_compatible"):
91-
if not dtype.kind == "m":
92-
raise ValueError("dtype must be a timedelta numpy dtype.")
93-
elif not (isinstance(dtype, np.dtype) and dtype.kind == "m"):
94-
raise ValueError("dtype must be a timedelta numpy dtype.")
90+
if dtype.kind != "m":
91+
raise ValueError("dtype must be a timedelta dtype.")
9592
return plc_column, dtype
9693

9794
def _clear_cache(self) -> None:
@@ -214,8 +211,7 @@ def _binaryop(self, other: ColumnBinaryOperand, op: str) -> ColumnBase:
214211
other,
215212
bool_fill_value=fill_value,
216213
)
217-
if cudf.get_option("mode.pandas_compatible"):
218-
result = result.fillna(fill_value)
214+
result = result.fillna(fill_value)
219215
return result
220216

221217
if out_dtype is None:

0 commit comments

Comments
 (0)