diff --git a/fastparquet/dataframe.py b/fastparquet/dataframe.py index d51889d3..7c46a53f 100644 --- a/fastparquet/dataframe.py +++ b/fastparquet/dataframe.py @@ -195,7 +195,7 @@ def set_cats(values, i=i, col=col, **kwargs): values = Categorical.from_codes(codes=code, dtype=bvalues.dtype) - elif getattr(bvalues.dtype, 'tz', None): + elif isinstance(dtype, pd.DatetimeTZDtype): dt = "M8[ns]" if PANDAS_VERSION.major < 2 else f'M8[{bvalues.dtype.unit}]' values = np.zeros(shape=shape, dtype=dt) values = type(bvalues)._from_sequence(values, copy=False, dtype=bvalues.dtype)