diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 4a8f1292ecdef..aa3cdcd65b344 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -638,7 +638,11 @@ def is_any_int_dtype(arr_or_dtype) -> bool: >>> is_any_int_dtype(pd.Index([1, 2.])) # float False """ - return _is_dtype_type(arr_or_dtype, classes(np.integer, np.timedelta64)) + return _is_dtype_type( + arr_or_dtype, classes(np.integer, np.timedelta64) + ) or _is_dtype( + arr_or_dtype, lambda typ: isinstance(typ, ExtensionDtype) and typ.kind in "iu" + ) def is_integer_dtype(arr_or_dtype) -> bool: diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 78c49ae066288..0a7303ea239ed 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -35,6 +35,8 @@ ) from pandas.errors import PerformanceWarning +from pandas.core.dtypes.common import is_any_int_dtype + import pandas as pd import pandas._testing as tm from pandas.api.types import ( @@ -1459,6 +1461,15 @@ def test_is_integer_dtype(data): assert not is_integer_dtype(data) +def test_is_any_integer_dtype(data): + # GH 50667 + pa_type = data.dtype.pyarrow_dtype + if pa.types.is_integer(pa_type): + assert is_any_int_dtype(data) + else: + assert not is_any_int_dtype(data) + + def test_is_signed_integer_dtype(data): pa_type = data.dtype.pyarrow_dtype if pa.types.is_signed_integer(pa_type):