-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Conversation
@@ -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. |
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.
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
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.
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.
deal-breaker?
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 since the behavior of int inputs with unit=None
doesn't change (albeit ambiguous) I suppose this is OK
Thanks @jbrockmendel |
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
xref #55499