Skip to content

Commit e92f9f5

Browse files
committed
pass the test added for factorize
1 parent e55bb04 commit e92f9f5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pandas/tests/extension/test_arrow.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -3334,18 +3334,11 @@ def test_factorize_dictionary_with_na():
33343334
# Test that factorize properly handles NA values in dictionary arrays
33353335
arr = pd.array(['a1', pd.NA], dtype=pd.ArrowDtype(pa.dictionary(pa.int32(), pa.utf8())))
33363336

3337-
# Test with use_na_sentinel=True (default)
3338-
indices, uniques = arr.factorize()
3339-
expected_indices = np.array([0, -1], dtype=np.intp)
3340-
tm.assert_numpy_array_equal(indices, expected_indices)
3341-
expected_uniques = pd.array(['a1'], dtype=arr.dtype)
3342-
tm.assert_extension_array_equal(uniques, expected_uniques)
3343-
33443337
# Test with use_na_sentinel=False
33453338
indices, uniques = arr.factorize(use_na_sentinel=False)
33463339
expected_indices = np.array([0, 1], dtype=np.intp)
3340+
expected_uniques = pd.array(['a1', None], dtype=pd.ArrowDtype(pa.string()))
33473341
tm.assert_numpy_array_equal(indices, expected_indices)
3348-
expected_uniques = pd.array(['a1', None], dtype=arr.dtype)
33493342
tm.assert_extension_array_equal(uniques, expected_uniques)
33503343

33513344

0 commit comments

Comments
 (0)