File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ Numeric
234
234
Conversion
235
235
^^^^^^^^^^
236
236
- Bug in :class: `Series ` construction from NumPy array with big-endian ``datetime64 `` dtype (:issue: `29684 `)
237
- -
237
+ - Bug in :class: ` Timedelta ` construction with large nanoseconds keyword value ( :issue: ` 34202 `)
238
238
-
239
239
240
240
Strings
Original file line number Diff line number Diff line change @@ -1198,7 +1198,7 @@ class Timedelta(_Timedelta):
1198
1198
1199
1199
kwargs = {key: _to_py_int_float(kwargs[key]) for key in kwargs}
1200
1200
1201
- nano = np.timedelta64 (kwargs.pop(' nanoseconds' , 0 ), ' ns' )
1201
+ nano = convert_to_timedelta64 (kwargs.pop(' nanoseconds' , 0 ), ' ns' )
1202
1202
try :
1203
1203
value = nano + convert_to_timedelta64(timedelta(** kwargs),
1204
1204
' ns' )
Original file line number Diff line number Diff line change @@ -28,3 +28,9 @@ def test_delta_to_nanoseconds_error():
28
28
29
29
with pytest .raises (TypeError , match = "<class 'numpy.ndarray'>" ):
30
30
delta_to_nanoseconds (obj )
31
+
32
+
33
+ def test_huge_nanoseconds_overflow ():
34
+ # GH 32402
35
+ assert delta_to_nanoseconds (Timedelta (1e10 )) == 1e10
36
+ assert delta_to_nanoseconds (Timedelta (nanoseconds = 1e10 )) == 1e10
You can’t perform that action at this time.
0 commit comments