Skip to content

Commit

Permalink
simplfiying suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Oct 23, 2023
1 parent 6e2e305 commit 76d3c3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastparquet/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76d3c3d

Please sign in to comment.