Skip to content

DEPR: deprecated sheetname from ExcelFile.parse #20938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CLN: removed error/warning raising process from read_excel
* removed error/warning raising process from read_excel
* changed calling method from ExcelFile._parse_excel to ExcelFile.parse,
which calls _parse_excel and raises the same error/warning

Related issue: #20920
  • Loading branch information
deflatSOCO committed May 4, 2018
commit 1b893df0e07009da23e23ee3640a1efc8a48a9d6
11 changes: 1 addition & 10 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,19 +303,10 @@ def read_excel(io,
convert_float=True,
**kwds):

# Can't use _deprecate_kwarg since sheetname=None has a special meaning
if is_integer(sheet_name) and sheet_name == 0 and 'sheetname' in kwds:
warnings.warn("The `sheetname` keyword is deprecated, use "
"`sheet_name` instead", FutureWarning, stacklevel=2)
sheet_name = kwds.pop("sheetname")
elif 'sheetname' in kwds:
raise TypeError("Cannot specify both `sheet_name` and `sheetname`. "
"Use just `sheet_name`")

if not isinstance(io, ExcelFile):
io = ExcelFile(io, engine=engine)

return io._parse_excel(
return io.parse(
sheet_name=sheet_name,
header=header,
names=names,
Expand Down