Skip to content

Commit e1caeb1

Browse files
author
Maria Stazherova
committed
fillna parr test added
1 parent 05e9359 commit e1caeb1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pandas/tests/series/methods/test_fillna.py

+26
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
date_range,
2121
isna,
2222
)
23+
from pandas.core.arrays import period_array
24+
2325
import pandas._testing as tm
2426

2527

@@ -946,3 +948,27 @@ def test_datetime64tz_fillna_round_issue(self):
946948
)
947949

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

0 commit comments

Comments
 (0)