Skip to content

Commit d5e0bd5

Browse files
committed
ERR: more informative message on invalid Timestamp input
1 parent 748000d commit d5e0bd5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tslib.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ class Timestamp(_Timestamp):
489489

490490
def __reduce__(self):
491491
object_state = self.value, self.freq, self.tzinfo
492+
print(object_state)
492493
return (Timestamp, object_state)
493494

494495
def to_period(self, freq=None):
@@ -1539,7 +1540,8 @@ cdef convert_to_tsobject(object ts, object tz, object unit,
15391540
"Cannot convert Period to Timestamp "
15401541
"unambiguously. Use to_timestamp")
15411542
else:
1542-
raise TypeError('Cannot convert input to Timestamp')
1543+
raise TypeError('Cannot convert input [{}] of type {} to '
1544+
'Timestamp'.format(ts, type(ts)))
15431545

15441546
if obj.value != NPY_NAT:
15451547
_check_dts_bounds(&obj.dts)

0 commit comments

Comments
 (0)