diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py index d6b9e7d5835..a664c4fb182 100644 --- a/python/cudf/cudf/core/series.py +++ b/python/cudf/cudf/core/series.py @@ -4775,6 +4775,11 @@ def cumprod(self, axis=0, skipna=True, *args, **kwargs): if axis not in (None, 0): raise NotImplementedError("axis parameter is not implemented yet") + if is_decimal_dtype(self.dtype): + raise NotImplementedError( + "cumprod does not currently support decimal types" + ) + skipna = True if skipna is None else skipna if skipna: @@ -4787,11 +4792,6 @@ def cumprod(self, axis=0, skipna=True, *args, **kwargs): ) result_col[first_index:] = None - if is_decimal_dtype(result_col.dtype): - raise NotImplementedError( - "cumprod does not currently support decimal types" - ) - # pandas always returns int64 dtype if original dtype is int or `bool` if np.issubdtype(result_col.dtype, np.integer) or np.issubdtype( result_col.dtype, np.bool_