Skip to content

Commit 34e3d82

Browse files
committed
TST: add tests with np._str, missing value
1 parent edf138d commit 34e3d82

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tests/arrays/string_/test_string.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,18 @@ def test_reduce_missing(skipna, dtype):
423423

424424

425425
def test_fillna_args():
426+
# GH 37987
427+
426428
arr = pd.array(["a", pd.NA], dtype="string")
427-
arr.fillna(value="b")
428429

429-
arr = pd.array(["a", "b"], dtype="string")
430+
res = arr.fillna(value="b")
431+
expected = pd.array(["a", "b"], dtype="string")
432+
tm.assert_extension_array_equal(res, expected)
433+
434+
res = arr.fillna(value=np.str_("b"))
435+
expected = pd.array(["a", "b"], dtype="string")
436+
tm.assert_extension_array_equal(res, expected)
437+
430438
msg = r"1 is not a valid fill value; must be a string"
431439
with pytest.raises(TypeError, match=msg):
432440
arr.fillna(value=1)

0 commit comments

Comments
 (0)