BUG: Series.cumin/cummax fails with datetime64[ns, tz] dtype · Issue #15553 · pandas-dev/pandas (original) (raw)

@jreback

works with naive dt, should work with tz-aware

In [40]: s = Series(pd.date_range('20130101', periods=2))

In [41]: s.where(s>s,s)
Out[41]: 
0   2013-01-01
1   2013-01-02
dtype: datetime64[ns]

In [42]: s = Series(pd.date_range('20130101', periods=2, tz='US/Eastern'))

In [43]: s.where(s>s,s)
TypeError: invalid type promotion
TypeError: Could not operate [array(['2013-01-01T05:00:00.000000000', '2013-01-02T05:00:00.000000000'], dtype='datetime64[ns]')] with block values [invalid type promotion]