-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: subclassing Index #52186
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: subclassing Index #52186
Conversation
@@ -31,32 +31,6 @@ There are functions that make the creation of a regular index easy: | |||
* :func:`period_range`: fixed frequency date range generated from a time rule or | |||
DateOffset. An ndarray of :class:`Period` objects, representing timespans | |||
|
|||
The motivation for having an ``Index`` class in the first place was to enable |
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.
Would be good to add a .. warning::
block here noting that subclassing an Index is not officially supported and users should use the extension array interface instead
doc/source/development/internals.rst
Outdated
* :meth:`~Index.delete`: Delete a label, yielding a new object | ||
* :meth:`~Index.drop`: Deletes a set of labels | ||
* :meth:`~Index.take`: Analogous to ndarray.take | ||
.. warning:: Custom :class:`Index` subclasses are not supported, custom behavior should |
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.
The doc build is failing since the note should start on a new line and indented (similar to .. note::
blocks)
Thanks @jbrockmendel |
pandas.Index
cannot be subclassed (despite saying it can be in the docs) #37882doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This is just a docs change, removing the wording that suggests we explicitly support subclassing Index. So it shouldn't break any implementations in the wild.