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

Conversation

Projects
None yet
2 participants
@jreback
Contributor

jreback commented May 1, 2016

xref #11758, fix for bug in #13033

@jreback jreback added Bug Compat labels May 1, 2016

@jreback jreback added this to the 0.18.1 milestone May 1, 2016

@jreback jreback merged commit b42d1dc into pandas-dev:master May 1, 2016

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@jorisvandenbossche

This comment has been minimized.

Show comment
Hide comment
@jorisvandenbossche

jorisvandenbossche May 2, 2016

Member

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'])

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

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback May 3, 2016

Contributor

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

Contributor

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.

nps added a commit to nps/pandas that referenced this pull request May 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment