Skip to content

Commit 9e8a243

Browse files
authored
TST: Add a test for fillna in PeriodArray (#50671)
1 parent d3f0e9a commit 9e8a243

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pandas/tests/series/methods/test_fillna.py

+24
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
isna,
2222
)
2323
import pandas._testing as tm
24+
from pandas.core.arrays import period_array
2425

2526

2627
class TestSeriesFillNA:
@@ -946,3 +947,26 @@ def test_datetime64tz_fillna_round_issue(self):
946947
)
947948

948949
tm.assert_series_equal(filled, expected)
950+
951+
def test_fillna_parr(self):
952+
# GH-24537
953+
dti = date_range(
954+
Timestamp.max - Timedelta(nanoseconds=10), periods=5, freq="ns"
955+
)
956+
ser = Series(dti.to_period("ns"))
957+
ser[2] = NaT
958+
arr = period_array(
959+
[
960+
Timestamp("2262-04-11 23:47:16.854775797"),
961+
Timestamp("2262-04-11 23:47:16.854775798"),
962+
Timestamp("2262-04-11 23:47:16.854775798"),
963+
Timestamp("2262-04-11 23:47:16.854775800"),
964+
Timestamp("2262-04-11 23:47:16.854775801"),
965+
],
966+
freq="ns",
967+
)
968+
expected = Series(arr)
969+
970+
filled = ser.fillna(method="pad")
971+
972+
tm.assert_series_equal(filled, expected)

0 commit comments

Comments
 (0)