Skip to content

Commit

Permalink
Backport PR pandas-dev#48562 on branch 1.5.x (TST: Testing that no wa…
Browse files Browse the repository at this point in the history
…rnings are emitted and that inplace fillna produces the correct result (GH48480)) (pandas-dev#48564)

Backport PR pandas-dev#48562: TST: Testing that no warnings are emitted and that inplace fillna produces the correct result (GH48480)

Co-authored-by: RaphSku <45042665+RaphSku@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and RaphSku committed Sep 15, 2022
1 parent b160966 commit 307ce80
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pandas/tests/frame/methods/test_fillna.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,3 +780,16 @@ def test_fillna_nonconsolidated_frame():
df_nonconsol = df.pivot(index="i1", columns="i2")
result = df_nonconsol.fillna(0)
assert result.isna().sum().sum() == 0


def test_fillna_nones_inplace():
# GH 48480
df = DataFrame(
[[None, None], [None, None]],
columns=["A", "B"],
)
with tm.assert_produces_warning(False):
df.fillna(value={"A": 1, "B": 2}, inplace=True)

expected = DataFrame([[1, 2], [1, 2]], columns=["A", "B"])
tm.assert_frame_equal(df, expected)

0 comments on commit 307ce80

Please sign in to comment.