-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: casting strings to float in to_datetime with unit #50909
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
DEPR: casting strings to float in to_datetime with unit #50909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is okay (+0) although it makes to_datetime
a little less convenient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Reckon the "inverse" should be deprecated as well, i.e. parsing numeric with format
as strings, like
In [3]: to_datetime([20200101], format='%Y%m%d')
Out[3]: DatetimeIndex(['2020-01-01'], dtype='datetime64[ns]', freq=None)
?
except OverflowError: | ||
return data, False | ||
except (TypeError, ValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this just to avoid hitting the warning later in to_datetime(new_data, errors="raise", unit=date_unit)
, which would be outofbounds anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct
That definitely seems like a potential footgun, no idea how common that is in the wild. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.