Skip to content

Commit

Permalink
Fix detection to raise warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Sep 30, 2016
1 parent b1c7f87 commit 656ec44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _parse_excel(self, sheetname=0, header=0, skiprows=None, names=None,
raise NotImplementedError("chunksize keyword of read_excel "
"is not implemented")

if parse_dates and not index_col:
if parse_dates is True and not index_col:
warn("The 'parse_dates=True' keyword of read_excel was provided"
" without an 'index_col' keyword value.")

Expand Down
5 changes: 3 additions & 2 deletions pandas/io/tests/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,9 @@ def test_read_excel_chunksize(self):
def test_read_excel_parse_dates(self):
# GH 11544, 12051

df = DataFrame({'col': [1, 2, 3],
'date_strings': pd.date_range('2012-01-01', periods=3)})
df = DataFrame(
{'col': [1, 2, 3],
'date_strings': pd.date_range('2012-01-01', periods=3)})
df2 = df.copy()
df2['date_strings'] = df2['date_strings'].dt.strftime('%m/%d/%Y')

Expand Down

0 comments on commit 656ec44

Please sign in to comment.