Skip to content

DOC: add closed and dtype in TimedeltaIndex parameters #49167

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class TimedeltaIndex(DatetimeTimedeltaMixin):
One of pandas date offset strings or corresponding objects. The string
'infer' can be passed in order to set the frequency of the index as the
inferred frequency upon creation.
closed : str, default None
Copy link
Member

Choose a reason for hiding this comment

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

@jbrockmendel should the TimedeltaIndex constructor accept closed? It appears not to do anything with the argument

Copy link
Contributor

Choose a reason for hiding this comment

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

Same was noticed in pandas-stubs by @Dr-Irv. We thought deprecation or just removal made the most sense.

Copy link
Member

Choose a reason for hiding this comment

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

agreed

Copy link
Author

Choose a reason for hiding this comment

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

Should I remove the closed parameter then?

Copy link
Contributor

@bashtage bashtage Oct 20, 2022

Choose a reason for hiding this comment

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

Ideally remove and deprecate closed using @deprecate_kwarg

Copy link
Author

Choose a reason for hiding this comment

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

I tried to find some other function that uses @depreceate_kwarg but couldn't find any, would it be something like this?

@deprecate_kwarg
closed : str, default None
    Make the interval closed with respect to the given frequency to
    the 'left', 'right', or both sides (None).

Copy link
Member

Choose a reason for hiding this comment

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

You can reference the @deprecate_kwarg usage from this older PR: #47912

Make the interval closed with respect to the given frequency to
the 'left', 'right', or both sides (None).
dtype : numpy.dtype or None, default dtype('<m8[ns]')
If None, dtype will be inferred.
copy : bool
Make a copy of input ndarray.
name : object
Expand Down