API: Timestamp.tz_convert/tz_localize raises Exception, should be TypeError (original) (raw)

Timestamp raises normal Exception in case of error, and we have to catch Exception for error handling.

Expect TypeError in consistent with DatetimeIndex.

pd.Timestamp('2011-01-01').tz_convert('US/Eastern')
# Exception: Cannot convert tz-naive Timestamp, use tz_localize to localize

pd.DatetimeIndex(['2011-01-01']).tz_convert('US/Eastern')
# TypeError: Cannot convert tz-naive timestamps, use tz_localize to localize