Skip to content

Commit 2038d7a

Browse files
jbrockmendeljreback
authored andcommitted
CLN: remove _set_subtyp (#31301)
1 parent a8c7bcc commit 2038d7a

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

pandas/core/dtypes/generic.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ def _check(cls, inst) -> bool:
5656
ABCSeries = create_pandas_abc_type("ABCSeries", "_typ", ("series",))
5757
ABCDataFrame = create_pandas_abc_type("ABCDataFrame", "_typ", ("dataframe",))
5858

59-
ABCSparseArray = create_pandas_abc_type(
60-
"ABCSparseArray", "_subtyp", ("sparse_array", "sparse_series")
61-
)
59+
ABCSparseArray = create_pandas_abc_type("ABCSparseArray", "_subtyp", ("sparse_array",))
6260
ABCCategorical = create_pandas_abc_type("ABCCategorical", "_typ", ("categorical"))
6361
ABCDatetimeArray = create_pandas_abc_type("ABCDatetimeArray", "_typ", ("datetimearray"))
6462
ABCTimedeltaArray = create_pandas_abc_type(

pandas/core/series.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def _can_hold_na(self):
392392

393393
_index = None
394394

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

416-
self._set_subtyp(is_all_dates)
417-
418416
object.__setattr__(self, "_index", labels)
419417
if not fastpath:
420418
self._data.set_axis(axis, labels)
421419

422-
def _set_subtyp(self, is_all_dates):
423-
if is_all_dates:
424-
object.__setattr__(self, "_subtyp", "time_series")
425-
else:
426-
object.__setattr__(self, "_subtyp", "series")
427-
428420
def _update_inplace(self, result, **kwargs):
429421
# we want to call the generic version and not the IndexOpsMixin
430422
return generic.NDFrame._update_inplace(self, result, **kwargs)

0 commit comments

Comments
 (0)