Skip to content

Commit 6a2511c

Browse files
committed
Issue pandas-dev#30520 works for timedeltas as well
1 parent dcb45ed commit 6a2511c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def maybe_box_datetimelike(value):
8787
if isinstance(value, (np.datetime64, datetime)) \
8888
and not isinstance(value, tslibs.Timestamp):
8989
value = tslibs.Timestamp(value)
90-
elif isinstance(value, (np.timedelta64, timedelta)):
90+
elif isinstance(value, (np.timedelta64, timedelta)) \
91+
and not isinstance(value, tslibs.Timedelta):
9192
value = tslibs.Timedelta(value)
9293

9394
return value

0 commit comments

Comments
 (0)