Skip to content

Commit 26a9658

Browse files
author
Jiang Yue
committed
add test for integer-na
1 parent f1b9408 commit 26a9658

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/dtypes/test_inference.py

+10
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,16 @@ def test_integers(self):
577577
result = lib.infer_dtype(arr, skipna=True)
578578
assert result == "integer"
579579

580+
# GH 27392
581+
def test_integer_na(self):
582+
arr = np.array([1, 2, np.nan, np.nan, 3], dtype="O")
583+
result = lib.infer_dtype(arr, skipna=False)
584+
assert result == "integer-na"
585+
586+
arr = np.array([1, 2, 3, np.int64(4), np.int32(5), np.nan], dtype="O")
587+
result = lib.infer_dtype(arr, skipna=False)
588+
assert result == "integer-na"
589+
580590
def test_deprecation(self):
581591
# GH 24050
582592
arr = np.array([1, 2, 3], dtype=object)

0 commit comments

Comments
 (0)