Skip to content

Commit c01532e

Browse files
authored
TST: Testing that no warnings are emitted and that inplace fillna produces the correct result (GH48480) (#48562)
Added test to test_fillna.py which checks that no warning is emitted and that the result is correct according to GH 48480 Co-authored-by: RaphSku <[email protected]>
1 parent faa8114 commit c01532e

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)