File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -638,7 +638,11 @@ def is_any_int_dtype(arr_or_dtype) -> bool:
638
638
>>> is_any_int_dtype(pd.Index([1, 2.])) # float
639
639
False
640
640
"""
641
- return _is_dtype_type (arr_or_dtype , classes (np .integer , np .timedelta64 ))
641
+ return _is_dtype_type (
642
+ arr_or_dtype , classes (np .integer , np .timedelta64 )
643
+ ) or _is_dtype (
644
+ arr_or_dtype , lambda typ : isinstance (typ , ExtensionDtype ) and typ .kind in "iu"
645
+ )
642
646
643
647
644
648
def is_integer_dtype (arr_or_dtype ) -> bool :
Original file line number Diff line number Diff line change 35
35
)
36
36
from pandas .errors import PerformanceWarning
37
37
38
+ from pandas .core .dtypes .common import is_any_int_dtype
39
+
38
40
import pandas as pd
39
41
import pandas ._testing as tm
40
42
from pandas .api .types import (
@@ -1459,6 +1461,15 @@ def test_is_integer_dtype(data):
1459
1461
assert not is_integer_dtype (data )
1460
1462
1461
1463
1464
+ def test_is_any_integer_dtype (data ):
1465
+ # GH 50667
1466
+ pa_type = data .dtype .pyarrow_dtype
1467
+ if pa .types .is_integer (pa_type ):
1468
+ assert is_any_int_dtype (data )
1469
+ else :
1470
+ assert not is_any_int_dtype (data )
1471
+
1472
+
1462
1473
def test_is_signed_integer_dtype (data ):
1463
1474
pa_type = data .dtype .pyarrow_dtype
1464
1475
if pa .types .is_signed_integer (pa_type ):
You can’t perform that action at this time.
0 commit comments