File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -523,10 +523,14 @@ cdef inline check_overflows(_TSObject obj):
523
523
# GH#12677
524
524
if obj.dts.year == 1677 :
525
525
if not (obj.value < 0 ):
526
- raise OutOfBoundsDatetime
526
+ raise OutOfBoundsDatetime(
527
+ f' Timestamp cannot be converted within implementation bounds'
528
+ )
527
529
elif obj.dts.year == 2262 :
528
530
if not (obj.value > 0 ):
529
- raise OutOfBoundsDatetime
531
+ raise OutOfBoundsDatetime(
532
+ f' Timestamp cannot be converted within implementation bounds'
533
+ )
530
534
531
535
532
536
# ----------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def test_tz_localize_pushes_out_of_bounds(self):
25
25
# GH#12677
26
26
# tz_localize that pushes away from the boundary is OK
27
27
pac = Timestamp .min .tz_localize ("US/Pacific" )
28
+ msg = "Timestamp cannot be converted within implementation bounds"
28
29
assert pac .value > Timestamp .min .value
29
30
pac .tz_convert ("Asia/Tokyo" ) # tz_convert doesn't change value
30
31
with pytest .raises (OutOfBoundsDatetime , match = msg ):
You can’t perform that action at this time.
0 commit comments