-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: to_timedelta box kwarg #30177
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: to_timedelta box kwarg #30177
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.
Looks good!
There is still a test using it apparently:
______________________ TestTimedeltas.test_to_timedelta _______________________
[gw0] win32 -- Python 3.7.5 C:\Miniconda\envs\pandas-dev\python.exe
self = <pandas.tests.indexes.timedeltas.test_tools.TestTimedeltas object at 0x000002A4A29A7AC8>
def test_to_timedelta(self):
def conv(v):
return v.astype("m8[ns]")
d1 = np.timedelta64(1, "D")
with tm.assert_produces_warning(FutureWarning):
> assert to_timedelta("1 days 06:05:01.00003", box=False) == conv(
d1
+ np.timedelta64(6 * 3600 + 5 * 60 + 1, "s")
+ np.timedelta64(30, "us")
)
E TypeError: to_timedelta() got an unexpected keyword argument 'box'
pandas\tests\indexes\timedeltas\test_tools.py:21: TypeError
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -540,6 +540,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more. | |||
- Changed the the default value of `inplace` in :meth:`DataFrame.set_index` and :meth:`Series.set_axis`. It now defaults to ``False`` (:issue:`27600`) | |||
- Removed the previously deprecated :attr:`Series.cat.categorical`, :attr:`Series.cat.index`, :attr:`Series.cat.name` (:issue:`24751`) | |||
- :func:`to_datetime` no longer accepts "box" argument, always returns :class:`DatetimeIndex` or :class:`Index`, :class:`Series`, or :class:`DataFrame` (:issue:`24486`) | |||
- :func:`to_timedelta` no longer accepts "box" argument, always returns :class:`TimedeltaIndex` or :class:`Index`, :class:`Series`, or :class:`DataFrame` (:issue:`24486`) |
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.
Can you combine this into the above, by saying "to_datetime and to_timedetal no longer accept .." ?
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.
combined
Thanks! |
Probably was intended to be done at the same time as the to_datetime version.
Also cleaning up some other things picked up by grepping for "deprecate"