BUG/COMPAT: to_datetime by jreback · Pull Request #13052 · pandas-dev/pandas (original) (raw)
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'])