Skip to content

Commit 307ce80

Browse files
Backport PR #48562 on branch 1.5.x (TST: Testing that no warnings are emitted and that inplace fillna produces the correct result (GH48480)) (#48564)
Backport PR #48562: TST: Testing that no warnings are emitted and that inplace fillna produces the correct result (GH48480) Co-authored-by: RaphSku <[email protected]>
1 parent b160966 commit 307ce80

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/frame/methods/test_fillna.py

+13
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,16 @@ def test_fillna_nonconsolidated_frame():
780780
df_nonconsol = df.pivot(index="i1", columns="i2")
781781
result = df_nonconsol.fillna(0)
782782
assert result.isna().sum().sum() == 0
783+
784+
785+
def test_fillna_nones_inplace():
786+
# GH 48480
787+
df = DataFrame(
788+
[[None, None], [None, None]],
789+
columns=["A", "B"],
790+
)
791+
with tm.assert_produces_warning(False):
792+
df.fillna(value={"A": 1, "B": 2}, inplace=True)
793+
794+
expected = DataFrame([[1, 2], [1, 2]], columns=["A", "B"])
795+
tm.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)