Skip to content

Commit c6050b5

Browse files
committed
chained, weak inequalities
1 parent 6e59a2d commit c6050b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ cdef _timedelta_from_value_and_reso(cls, int64_t value, NPY_DATETIMEUNIT reso):
10221022
elif reso == NPY_DATETIMEUNIT.NPY_FR_us:
10231023
td_base = _Timedelta.__new__(cls, microseconds=int(value))
10241024
elif reso == NPY_DATETIMEUNIT.NPY_FR_ms:
1025-
if value > -86_399_999_913_600_000 and value < 86_400_000_000_000_000:
1025+
if -86_399_999_913_600_000 <= value <= 86_400_000_000_000_000:
10261026
# i.e. we are in range for pytimedelta. By passing the
10271027
# 'correct' value here we can
10281028
# make pydatetime + Timedelta operations work correctly,
@@ -1031,7 +1031,7 @@ cdef _timedelta_from_value_and_reso(cls, int64_t value, NPY_DATETIMEUNIT reso):
10311031
else:
10321032
td_base = _Timedelta.__new__(cls, milliseconds=0)
10331033
elif reso == NPY_DATETIMEUNIT.NPY_FR_s:
1034-
if value > -86_399_999_913_600 and value < 86_400_000_000_000:
1034+
if -86_399_999_913_600 <= value <= 86_400_000_000_000:
10351035
# i.e. we are in range for pytimedelta. By passing the
10361036
# 'correct' value here we can
10371037
# make pydatetime + Timedelta operations work correctly,

0 commit comments

Comments
 (0)