Skip to content

TST: More old issues #41712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 31, 2021
Merged
Prev Previous commit
Next Next commit
Add test for GH 31861
  • Loading branch information
mroeschke committed May 29, 2021
commit fdee1c70fe4cf009c5a502575476e5ded9af5f65
8 changes: 8 additions & 0 deletions pandas/tests/indexing/test_iloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pandas.util._test_decorators as td

from pandas import (
NA,
Categorical,
CategoricalDtype,
DataFrame,
Expand Down Expand Up @@ -1340,3 +1341,10 @@ def test_iloc_setitem_pure_position_based(self):
ser1.iloc[1:3] = ser2.iloc[1:3]
expected = Series([1, 5, 6])
tm.assert_series_equal(ser1, expected)

def test_iloc_nullable_int64_size_1_nan(self):
# GH 31861
result = DataFrame({"a": ["test"], "b": [np.nan]})
result.loc[:, "b"] = result.loc[:, "b"].astype("Int64")
expected = DataFrame({"a": ["test"], "b": array([NA], dtype="Int64")})
tm.assert_frame_equal(result, expected)