Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions pandas/core/dtypes/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def _check(cls, inst) -> bool:
ABCSeries = create_pandas_abc_type("ABCSeries", "_typ", ("series",))
ABCDataFrame = create_pandas_abc_type("ABCDataFrame", "_typ", ("dataframe",))

ABCSparseArray = create_pandas_abc_type(
"ABCSparseArray", "_subtyp", ("sparse_array", "sparse_series")
)
ABCSparseArray = create_pandas_abc_type("ABCSparseArray", "_subtyp", ("sparse_array",))
ABCCategorical = create_pandas_abc_type("ABCCategorical", "_typ", ("categorical"))
ABCDatetimeArray = create_pandas_abc_type("ABCDatetimeArray", "_typ", ("datetimearray"))
ABCTimedeltaArray = create_pandas_abc_type(
Expand Down
10 changes: 1 addition & 9 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def _can_hold_na(self):

_index = None

def _set_axis(self, axis, labels, fastpath=False) -> None:
def _set_axis(self, axis, labels, fastpath: bool = False) -> None:
"""
Override generic, we want to set the _typ here.
"""
Expand All @@ -413,18 +413,10 @@ def _set_axis(self, axis, labels, fastpath=False) -> None:
# or not be a DatetimeIndex
pass

self._set_subtyp(is_all_dates)

object.__setattr__(self, "_index", labels)
if not fastpath:
self._data.set_axis(axis, labels)

def _set_subtyp(self, is_all_dates):
if is_all_dates:
object.__setattr__(self, "_subtyp", "time_series")
else:
object.__setattr__(self, "_subtyp", "series")

def _update_inplace(self, result, **kwargs):
# we want to call the generic version and not the IndexOpsMixin
return generic.NDFrame._update_inplace(self, result, **kwargs)
Expand Down