From e55c9f0f8b208d8d9839b2f5029e2571234ccb55 Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Mon, 14 Nov 2022 11:42:05 +0000 Subject: [PATCH] Promote type in DateTimeIndex.microsecond as well --- python/cudf/cudf/core/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/core/index.py b/python/cudf/cudf/core/index.py index 61971e3c749..e561dd0a214 100644 --- a/python/cudf/cudf/core/index.py +++ b/python/cudf/cudf/core/index.py @@ -2072,7 +2072,10 @@ def microsecond(self): """ # noqa: E501 return as_index( ( - self._values.get_dt_field("millisecond") + # Need to manually promote column to int32 because + # pandas-matching binop behaviour requires that this + # __mul__ returns an int16 column. + self._values.get_dt_field("millisecond").astype("int32") * cudf.Scalar(1000, dtype="int32") ) + self._values.get_dt_field("microsecond"),