Skip to content

Commit 9b46a69

Browse files
committed
Merge pull request #8405 from sh9189/bbopensrcday
Better message in exception when conversion from period to timestamp fai...
2 parents 68fdacd + 26905ab commit 9b46a69

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/tslib.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,7 @@ cdef convert_to_tsobject(object ts, object tz, object unit):
10721072
ts = datetime.combine(ts, datetime_time())
10731073
return convert_to_tsobject(ts, tz, None)
10741074
else:
1075-
raise ValueError("Could not construct Timestamp from argument %s" %
1076-
type(ts))
1075+
raise ValueError("Cannot convert Period to Timestamp unambiguously. Use to_timestamp")
10771076

10781077
if obj.value != NPY_NAT:
10791078
_check_dts_bounds(&obj.dts)

0 commit comments

Comments
 (0)