Skip to content

Commit 0e59178

Browse files
authored
Add tests for categorical with null ea as input (#37611)
1 parent b966657 commit 0e59178

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/arrays/categorical/test_constructors.py

+7
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,10 @@ def test_interval(self):
682682
expected_codes = np.array([0, 1], dtype="int8")
683683
tm.assert_numpy_array_equal(cat.codes, expected_codes)
684684
tm.assert_index_equal(cat.categories, idx)
685+
686+
def test_categorical_extension_array_nullable(self, nulls_fixture):
687+
# GH:
688+
arr = pd.arrays.StringArray._from_sequence([nulls_fixture] * 2)
689+
result = Categorical(arr)
690+
expected = Categorical(Series([pd.NA, pd.NA], dtype="object"))
691+
tm.assert_categorical_equal(result, expected)

0 commit comments

Comments
 (0)