Skip to content

Commit 1d41be4

Browse files
authored
CLN: remove ABCGeneric (#33088)
1 parent 36d6583 commit 1d41be4

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

pandas/core/dtypes/generic.py

-8
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,3 @@ def _check(cls, inst) -> bool:
7171
("extension", "categorical", "periodarray", "datetimearray", "timedeltaarray"),
7272
)
7373
ABCPandasArray = create_pandas_abc_type("ABCPandasArray", "_typ", ("npy_extension",))
74-
75-
76-
class _ABCGeneric(type):
77-
def __instancecheck__(cls, inst) -> bool:
78-
return hasattr(inst, "_data")
79-
80-
81-
ABCGeneric = _ABCGeneric("ABCGeneric", tuple(), {})

pandas/core/dtypes/missing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
pandas_dtype,
3434
)
3535
from pandas.core.dtypes.generic import (
36+
ABCDataFrame,
3637
ABCDatetimeArray,
3738
ABCExtensionArray,
38-
ABCGeneric,
3939
ABCIndexClass,
4040
ABCMultiIndex,
4141
ABCSeries,
@@ -151,7 +151,7 @@ def _isna_new(obj):
151151
),
152152
):
153153
return _isna_ndarraylike(obj)
154-
elif isinstance(obj, ABCGeneric):
154+
elif isinstance(obj, ABCDataFrame):
155155
return obj._constructor(obj._data.isna(func=isna))
156156
elif isinstance(obj, list):
157157
return _isna_ndarraylike(np.asarray(obj, dtype=object))
@@ -182,7 +182,7 @@ def _isna_old(obj):
182182
return False
183183
elif isinstance(obj, (ABCSeries, np.ndarray, ABCIndexClass, ABCExtensionArray)):
184184
return _isna_ndarraylike_old(obj)
185-
elif isinstance(obj, ABCGeneric):
185+
elif isinstance(obj, ABCDataFrame):
186186
return obj._constructor(obj._data.isna(func=_isna_old))
187187
elif isinstance(obj, list):
188188
return _isna_ndarraylike_old(np.asarray(obj, dtype=object))

0 commit comments

Comments
 (0)