Skip to content

Commit 3639fd7

Browse files
committed
Added deprecation warning to Timestamp constructor
1 parent c0371ce commit 3639fd7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/_libs/tslibs/timestamps.pyx

+8
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,14 @@ class Timestamp(_Timestamp):
26352635
elif not (999 >= nanosecond >= 0):
26362636
raise ValueError("nanosecond must be in 0..999")
26372637
2638+
if ts_input == "":
2639+
warnings.warn(
2640+
"Passing an empty string to Timestamp is deprecated and will raise "
2641+
"a ValueError in a future version.",
2642+
FutureWarning,
2643+
stacklevel = 2
2644+
)
2645+
26382646
ts = convert_to_tsobject(ts_input, tzobj, unit, 0, 0, nanosecond)
26392647
26402648
if ts.value == NPY_NAT:

0 commit comments

Comments
 (0)