diff --git a/datashader/datashape/coretypes.py b/datashader/datashape/coretypes.py index a6c9bcf1f..637683e6b 100644 --- a/datashader/datashape/coretypes.py +++ b/datashader/datashape/coretypes.py @@ -775,7 +775,7 @@ def from_numpy_dtype(self, dt): elif np.issubdtype(dt, np.timedelta64): unit, _ = np.datetime_data(dt) return TimeDelta(unit=unit) - elif np.issubdtype(dt, np.unicode_): + elif np.__version__[0] < "2" and np.issubdtype(dt, np.unicode_): # noqa: NPY201 return String(dt.itemsize // 4, 'U32') elif np.issubdtype(dt, np.str_) or np.issubdtype(dt, np.bytes_): return String(dt.itemsize, 'ascii')