Skip to content

Commit 306be68

Browse files
committed
Change TypeErrors to ValueErrors
1 parent d299ecd commit 306be68

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/frame.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ def from_items(cls, items, columns=None, orient='columns'):
12791279

12801280
except ValueError:
12811281
if not is_nested_list_like(values):
1282-
raise TypeError('The value in each (key, value) pair must '
1282+
raise ValueError('The value in each (key, value) pair must '
12831283
'be an array, Series, or dict')
12841284

12851285
elif orient == 'index':
@@ -1297,7 +1297,7 @@ def from_items(cls, items, columns=None, orient='columns'):
12971297

12981298
except TypeError:
12991299
if not is_nested_list_like(values):
1300-
raise TypeError('The value in each (key, value) pair must '
1300+
raise ValueError('The value in each (key, value) pair must '
13011301
'be an array, Series, or dict')
13021302

13031303
else: # pragma: no cover

pandas/tests/frame/test_constructors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1207,12 +1207,12 @@ def test_constructor_from_items(self):
12071207

12081208
def test_constructor_from_items_scalars(self):
12091209
# GH 17312
1210-
with tm.assert_raises_regex(TypeError,
1210+
with tm.assert_raises_regex(ValueError,
12111211
'The value in each \(key, value\) '
12121212
'pair must be an array, Series, or dict'):
12131213
DataFrame.from_items([('A', 1), ('B', 4)])
12141214

1215-
with tm.assert_raises_regex(TypeError,
1215+
with tm.assert_raises_regex(ValueError,
12161216
'The value in each \(key, value\) '
12171217
'pair must be an array, Series, or dict'):
12181218
DataFrame.from_items([('A', 1), ('B', 2)], columns=['col1'],

0 commit comments

Comments
 (0)