Skip to content

API: Timestamp.tz_convert/tz_localize raises Exception, should be TypeError #8025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sinhrks opened this issue Aug 14, 2014 · 2 comments · Fixed by #8036
Closed

API: Timestamp.tz_convert/tz_localize raises Exception, should be TypeError #8025

sinhrks opened this issue Aug 14, 2014 · 2 comments · Fixed by #8036
Labels
Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Aug 14, 2014

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
@jreback jreback added this to the 0.15.0 milestone Aug 14, 2014
@jreback
Copy link
Contributor

jreback commented Aug 14, 2014

sure

@jreback
Copy link
Contributor

jreback commented Aug 15, 2014

looks fine, ping when green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants