Skip to content

Commit 1204688

Browse files
committed
BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (pandas-dev#46673)
1 parent ed3a044 commit 1204688

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/tests/frame/methods/test_dtypes.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ def test_dtypes_are_correct_after_column_slice(self):
8282

8383
@pytest.mark.parametrize(
8484
"data",
85-
[
86-
[True, pd.NA, pd.NA, False],
87-
[True, pd.NA, True, False],
88-
],
85+
[pd.NA, True],
8986
)
9087
def test_dtypes_are_correct_after_groupby_last(self, data):
9188
# GH46409
92-
df = DataFrame({"id": [1, 2, 3, 4], "test": data}).convert_dtypes()
89+
df = DataFrame(
90+
{"id": [1, 2, 3, 4], "test": [True, pd.NA, data, False]}
91+
).convert_dtypes()
9392
result = df.groupby("id").last().test
9493
expected = df.set_index("id").test
9594
assert result.dtype == pd.BooleanDtype()

0 commit comments

Comments
 (0)