Skip to content

Commit f95576b

Browse files
yui-knkjreback
authored andcommitted
BUG: Fix TimeDelta to Timedelta (pandas-dev#13600)
1 parent ba82b51 commit f95576b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/tseries/tests/test_timedeltas.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ def test_construction(self):
137137
self.assertRaises(ValueError, lambda: Timedelta('3.1415'))
138138

139139
# invalid construction
140-
tm.assertRaisesRegexp(ValueError, "cannot construct a TimeDelta",
140+
tm.assertRaisesRegexp(ValueError, "cannot construct a Timedelta",
141141
lambda: Timedelta())
142142
tm.assertRaisesRegexp(ValueError, "unit abbreviation w/o a number",
143143
lambda: Timedelta('foo'))
144144
tm.assertRaisesRegexp(ValueError,
145-
"cannot construct a TimeDelta from the passed "
145+
"cannot construct a Timedelta from the passed "
146146
"arguments, allowed keywords are ",
147147
lambda: Timedelta(day=10))
148148

pandas/tslib.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2615,7 +2615,7 @@ class Timedelta(_Timedelta):
26152615

26162616
if value is None:
26172617
if not len(kwargs):
2618-
raise ValueError("cannot construct a TimeDelta without a value/unit or descriptive keywords (days,seconds....)")
2618+
raise ValueError("cannot construct a Timedelta without a value/unit or descriptive keywords (days,seconds....)")
26192619

26202620
def _to_py_int_float(v):
26212621
if is_integer_object(v):
@@ -2630,7 +2630,7 @@ class Timedelta(_Timedelta):
26302630
nano = kwargs.pop('nanoseconds',0)
26312631
value = convert_to_timedelta64(timedelta(**kwargs),'ns',False) + nano
26322632
except TypeError as e:
2633-
raise ValueError("cannot construct a TimeDelta from the passed arguments, allowed keywords are "
2633+
raise ValueError("cannot construct a Timedelta from the passed arguments, allowed keywords are "
26342634
"[weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds]")
26352635

26362636
if isinstance(value, Timedelta):

0 commit comments

Comments
 (0)