Skip to content

Commit b3c6617

Browse files
committed
BUG: Fix is_signed_integer_dtype to handle abstract floating types (GH 62018) and add unit test
1 parent 65b2931 commit b3c6617

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/dtypes/test_dtypes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
is_dtype_equal,
1818
is_interval_dtype,
1919
is_period_dtype,
20+
is_signed_integer_dtype,
2021
is_string_dtype,
2122
)
2223
from pandas.core.dtypes.dtypes import (
@@ -1150,6 +1151,13 @@ def test_is_bool_dtype(dtype, expected):
11501151
assert result is expected
11511152

11521153

1154+
def test_is_signed_integer_dtype_with_abstract_types():
1155+
# GH 62018
1156+
assert is_signed_integer_dtype(np.floating) is False
1157+
assert is_signed_integer_dtype(np.inexact) is False
1158+
assert is_signed_integer_dtype(np.generic) is False
1159+
1160+
11531161
def test_is_bool_dtype_sparse():
11541162
result = is_bool_dtype(Series(SparseArray([True, False])))
11551163
assert result is True

0 commit comments

Comments
 (0)