Skip to content

Commit 08d4de3

Browse files
author
lucas
committed
BUG: #9798 index_col shouldn't accept the value True
check at ``TextFileReader`` ``clean_options``
1 parent f6eb10b commit 08d4de3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/io/parsers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ def _clean_options(self, options, engine):
652652
# really delete this one
653653
keep_default_na = result.pop('keep_default_na')
654654

655+
if index_col is True:
656+
raise ValueError("The value of index_col couldn't be 'True'")
655657
if _is_index_col(index_col):
656658
if not isinstance(index_col, (list, tuple, np.ndarray)):
657659
index_col = [index_col]
@@ -905,7 +907,7 @@ def _make_index(self, data, alldata, columns, indexnamerow=False):
905907

906908
def _get_simple_index(self, data, columns):
907909
def ix(col):
908-
if not (isinstance(col, compat.string_types) or col is True):
910+
if not isinstance(col, compat.string_types):
909911
return col
910912
raise ValueError('Index %s invalid' % col)
911913
index = None

0 commit comments

Comments
 (0)