Skip to content

Commit 48895ca

Browse files
committed
TST: Test for Period over maximum timestamp
1 parent c768e34 commit 48895ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/scalar/period/test_period.py

+7
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,13 @@ def test_period_cons_combined(self):
486486
with pytest.raises(ValueError, match=msg):
487487
Period("2011-01", freq="1D1W")
488488

489+
@pytest.mark.parametrize("hour", range(24))
490+
def test_period_large_ordinal(self, hour):
491+
# Issue #36430
492+
# Integer overflow for Period over the maximum timestamp
493+
p = pd.Period(ordinal=2562048 + hour, freq="1H")
494+
assert p.hour == hour
495+
489496

490497
class TestPeriodMethods:
491498
def test_round_trip(self):

0 commit comments

Comments
 (0)