diff --git a/pandas/tests/series/methods/test_fillna.py b/pandas/tests/series/methods/test_fillna.py index 47703b294c2b1..9fded26c37caf 100644 --- a/pandas/tests/series/methods/test_fillna.py +++ b/pandas/tests/series/methods/test_fillna.py @@ -21,6 +21,7 @@ isna, ) import pandas._testing as tm +from pandas.core.arrays import period_array class TestSeriesFillNA: @@ -946,3 +947,26 @@ def test_datetime64tz_fillna_round_issue(self): ) tm.assert_series_equal(filled, expected) + + def test_fillna_parr(self): + # GH-24537 + dti = date_range( + Timestamp.max - Timedelta(nanoseconds=10), periods=5, freq="ns" + ) + ser = Series(dti.to_period("ns")) + ser[2] = NaT + arr = period_array( + [ + Timestamp("2262-04-11 23:47:16.854775797"), + Timestamp("2262-04-11 23:47:16.854775798"), + Timestamp("2262-04-11 23:47:16.854775798"), + Timestamp("2262-04-11 23:47:16.854775800"), + Timestamp("2262-04-11 23:47:16.854775801"), + ], + freq="ns", + ) + expected = Series(arr) + + filled = ser.fillna(method="pad") + + tm.assert_series_equal(filled, expected)