Skip to content
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

BUG/COMPAT: to_datetime #13052

Merged
merged 1 commit into from
May 1, 2016
Merged

BUG/COMPAT: to_datetime #13052

merged 1 commit into from
May 1, 2016

Conversation

jreback
Copy link
Contributor

@jreback jreback commented May 1, 2016

xref #11758, fix for bug in #13033

@jreback jreback added Bug Compat pandas objects compatability with Numpy or Python functions labels May 1, 2016
@jreback jreback added this to the 0.18.1 milestone May 1, 2016
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented May 2, 2016

Jeff, IMO in some cases the ValueError you raise now is less informative as the Overflow error I think.

Eg in the case of pd.to_datetime([1, 2, 111111111], unit='D'), you now get a "ValueError: cannot convert input with unit: D" instead of "OverflowError: long too big to convert". I am not saying the OverflowError is very clear, but at least this gives some indication of why to_datetime could not convert the integers: the values are too big. While the new message does not give this indication, (but is clearer that something went wrong in the datetime conversion, for sure!).

Wouldn't it be possible to raise an OutOfBoundsError? Similar as you eg get with pd.to_datetime(['2900-01-01'])

@jreback
Copy link
Contributor Author

jreback commented May 3, 2016

@jorisvandenbossche yes I will change that to OOB. Though I may also do a VE if say non-convertible strings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants