Skip to content
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: unit keyword in TimedeltaIndex #55856

Merged
merged 6 commits into from
Dec 1, 2023

Conversation

jbrockmendel
Copy link
Member

xref #55499

@mroeschke mroeschke added Timedelta Timedelta data type Deprecate Functionality to remove in pandas labels Nov 7, 2023
@@ -64,6 +64,10 @@ class TimedeltaIndex(DatetimeTimedeltaMixin):
Optional timedelta-like data to construct index with.
unit : {'D', 'h', 'm', 's', 'ms', 'us', 'ns'}, optional
The unit of ``data``.

.. deprecated:: 2.2.0
Use ``pd.to_timedelta`` instead.
Copy link
Member

Choose a reason for hiding this comment

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

Does that mean that integer inputs are always interpreted as nanos or based on the unit in dtype? If so, would be good to explain that here

Copy link
Member Author

Choose a reason for hiding this comment

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

thats a bit ambiguous bc of #52457, #48312

Copy link
Member Author

Choose a reason for hiding this comment

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

deal-breaker?

Copy link
Member

Choose a reason for hiding this comment

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

I guess since the behavior of int inputs with unit=None doesn't change (albeit ambiguous) I suppose this is OK

@mroeschke mroeschke added this to the 2.2 milestone Dec 1, 2023
@mroeschke mroeschke merged commit 5dab6ad into pandas-dev:main Dec 1, 2023
40 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the depr-tdi-unit branch December 1, 2023 20:54
rapids-bot bot pushed a commit to rapidsai/cudf that referenced this pull request Feb 8, 2024
For comparison:

pandas-dev/pandas#55856
pandas-dev/pandas#55895
pandas-dev/pandas#55499

The `errors="ignore"` parameter is the only one that is implemented so just added a test for that deprecation

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #14984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants