diff --git a/python/cudf/cudf/_lib/types.pyx b/python/cudf/cudf/_lib/types.pyx index 929f8b447ab..d87104bf168 100644 --- a/python/cudf/cudf/_lib/types.pyx +++ b/python/cudf/cudf/_lib/types.pyx @@ -3,6 +3,7 @@ from enum import IntEnum import numpy as np +import pandas as pd from libcpp.memory cimport make_shared, shared_ptr @@ -270,9 +271,13 @@ cpdef dtype_to_pylibcudf_type(dtype): else: tid = pylibcudf.TypeId.DECIMAL32 return pylibcudf.DataType(tid, -dtype.scale) - return pylibcudf.DataType( - SUPPORTED_NUMPY_TO_PYLIBCUDF_TYPES[np.dtype(dtype)] - ) + + # libcudf types don't support localization so convert to the base type + if isinstance(dtype, pd.DatetimeTZDtype): + dtype = np.dtype(f"