Skip to content

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

Merged
merged 4 commits into from
Dec 11, 2019

Conversation

jbrockmendel
Copy link
Member

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"

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a 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

@@ -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`)
Copy link
Member

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 .." ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combined

@jorisvandenbossche jorisvandenbossche added Clean Deprecate Functionality to remove in pandas labels Dec 10, 2019
@jorisvandenbossche jorisvandenbossche added this to the 1.0 milestone Dec 10, 2019
@jorisvandenbossche jorisvandenbossche merged commit b22a0f7 into pandas-dev:master Dec 11, 2019
@jorisvandenbossche
Copy link
Member

Thanks!

@jbrockmendel jbrockmendel deleted the depr-box branch December 11, 2019 16:15
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants