Skip to content

CLN: remove ABCGeneric #33088

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

Merged
merged 1 commit into from
Mar 29, 2020
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
8 changes: 0 additions & 8 deletions pandas/core/dtypes/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,3 @@ def _check(cls, inst) -> bool:
("extension", "categorical", "periodarray", "datetimearray", "timedeltaarray"),
)
ABCPandasArray = create_pandas_abc_type("ABCPandasArray", "_typ", ("npy_extension",))


class _ABCGeneric(type):
def __instancecheck__(cls, inst) -> bool:
return hasattr(inst, "_data")


ABCGeneric = _ABCGeneric("ABCGeneric", tuple(), {})
6 changes: 3 additions & 3 deletions pandas/core/dtypes/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
pandas_dtype,
)
from pandas.core.dtypes.generic import (
ABCDataFrame,
ABCDatetimeArray,
ABCExtensionArray,
ABCGeneric,
ABCIndexClass,
ABCMultiIndex,
ABCSeries,
Expand Down Expand Up @@ -151,7 +151,7 @@ def _isna_new(obj):
),
):
return _isna_ndarraylike(obj)
elif isinstance(obj, ABCGeneric):
elif isinstance(obj, ABCDataFrame):
return obj._constructor(obj._data.isna(func=isna))
elif isinstance(obj, list):
return _isna_ndarraylike(np.asarray(obj, dtype=object))
Expand Down Expand Up @@ -182,7 +182,7 @@ def _isna_old(obj):
return False
elif isinstance(obj, (ABCSeries, np.ndarray, ABCIndexClass, ABCExtensionArray)):
return _isna_ndarraylike_old(obj)
elif isinstance(obj, ABCGeneric):
elif isinstance(obj, ABCDataFrame):
return obj._constructor(obj._data.isna(func=_isna_old))
elif isinstance(obj, list):
return _isna_ndarraylike_old(np.asarray(obj, dtype=object))
Expand Down