We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edf138d commit 34e3d82Copy full SHA for 34e3d82
pandas/tests/arrays/string_/test_string.py
@@ -423,10 +423,18 @@ def test_reduce_missing(skipna, dtype):
423
424
425
def test_fillna_args():
426
+ # GH 37987
427
+
428
arr = pd.array(["a", pd.NA], dtype="string")
- arr.fillna(value="b")
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
436
437
438
msg = r"1 is not a valid fill value; must be a string"
439
with pytest.raises(TypeError, match=msg):
440
arr.fillna(value=1)
0 commit comments