Skip to content

Commit 33c7ca5

Browse files
authored
Add a test as per PR guidelines
1 parent acac5eb commit 33c7ca5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/frame/methods/test_replace.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,3 +1518,10 @@ def test_replace_object_splitting(self, using_infer_string):
15181518
assert len(df._mgr.blocks) == 2
15191519
else:
15201520
assert len(df._mgr.blocks) == 1
1521+
1522+
def test_replace_bool_to_numpy_attributeerror(self):
1523+
# GH#47101
1524+
pass_pre_patch = pd.DataFrame({"d":[None]})
1525+
tm.assert_frame_equal(pass_pre_patch, pass_pre_patch.replace('', pd.NA))
1526+
fail_pre_patch = pd.DataFrame({"d":[pd.NA]})
1527+
tm.assert_frame_equal(fail_pre_match, fail_pre_patch.replace('', pd.NA))

0 commit comments

Comments
 (0)