Skip to content

Commit 7321a46

Browse files
Add new test for None values on string columns on a Dataframe (#52523)
* Add new test for None values on string columns on a Dataframe * Make changes in test for None values * Change the Dataframe in test for None values
1 parent 170e689 commit 7321a46

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/indexing/test_loc.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def test_not_change_nan_loc(series, new_series, expected_ser):
6262

6363

6464
class TestLoc:
65+
def test_none_values_on_string_columns(self):
66+
# Issue #32218
67+
df = DataFrame(["1", "2", None], columns=["a"], dtype="str")
68+
69+
assert df.loc[2, "a"] is None
70+
6571
@pytest.mark.parametrize("kind", ["series", "frame"])
6672
def test_loc_getitem_int(self, kind, request):
6773
# int label

0 commit comments

Comments
 (0)