Skip to content

BUG: Fix date_range overflow #23345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 28, 2018
Prev Previous commit
Next Next commit
Fixup GH references
  • Loading branch information
jbrockmendel committed Oct 26, 2018
commit 25c79de0ff88e80cb9545360c776874bcacb7d95
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ Datetimelike
- Bug in :class:`PeriodIndex` where adding or subtracting a :class:`timedelta` or :class:`Tick` object produced incorrect results (:issue:`22988`)
- Bug in :func:`date_range` when decrementing a start date to a past end date by a negative frequency (:issue:`23270`)
- Bug in :func:`DataFrame.combine` with datetimelike values raising a TypeError (:issue:`23079`)
- Bug in :func:`date_range` with frequency of ``Day`` or higher where dates sufficiently far in the future could wrap around to the past instead of raising ``OutOfBoundsDatetime`` (:issue:`19740`)
- Bug in :func:`date_range` with frequency of ``Day`` or higher where dates sufficiently far in the future could wrap around to the past instead of raising ``OutOfBoundsDatetime`` (:issue:`14187`)

Timedelta
^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ def _generate_range_overflow_safe(endpoint, periods, stride, side='start'):
------
OutOfBoundsDatetime
"""
# GH#19740 raise instead of incorrectly wrapping around
# GH#14187 raise instead of incorrectly wrapping around
assert side in ['start', 'end']
if side == 'end':
stride *= -1
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/datetimes/test_date_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_date_range_timestamp_equiv_preserve_frequency(self):

class TestDateRanges(TestData):
def test_date_range_out_of_bounds(self):
# GH#19740
# GH#14187
with pytest.raises(OutOfBoundsDatetime):
date_range('2016-01-01', periods=100000, freq='D')
with pytest.raises(OutOfBoundsDatetime):
Expand Down