Skip to content
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

CLN: Remove unused and undocumented kind keyword from read_excel #4713

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`
- Refactor of ``_get_numeric_data/_get_bool_data`` to core/generic.py, allowing Series/Panel functionaility
- Refactor of Series arithmetic with time-like objects (datetime/timedelta/time
etc.) into a separate, cleaned up wrapper class. (:issue:`4613`)
- Remove undocumented/unused ``kind`` keyword argument from ``read_excel``, and ``ExcelFile``. (:issue:`4713`, :issue:`4712`)

**Experimental Features**

Expand Down
13 changes: 8 additions & 5 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
from pandas import json
from pandas.compat import map, zip, reduce, range, lrange
import pandas.compat as compat
from warnings import warn


def read_excel(path_or_buf, sheetname, kind=None, **kwds):
def read_excel(path_or_buf, sheetname, **kwds):
"""Read an Excel table into a pandas DataFrame

Parameters
Expand Down Expand Up @@ -50,8 +51,11 @@ def read_excel(path_or_buf, sheetname, kind=None, **kwds):
parsed : DataFrame
DataFrame from the passed in Excel file
"""
return ExcelFile(path_or_buf, kind=kind).parse(sheetname=sheetname,
kind=kind, **kwds)
if 'kind' in kwds:
kwds.pop('kind')
warn("kind keyword is no longer supported in read_excel and may be "
"removed in a future version", FutureWarning)
return ExcelFile(path_or_buf).parse(sheetname=sheetname, **kwds)


class ExcelFile(object):
Expand All @@ -64,8 +68,7 @@ class ExcelFile(object):
path : string or file-like object
Path to xls or xlsx file
"""
def __init__(self, path_or_buf, kind=None, **kwds):
self.kind = kind
def __init__(self, path_or_buf, **kwds):

import xlrd # throw an ImportError if we need to

Expand Down
4 changes: 2 additions & 2 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,6 @@ def __init__(self, path):
super(ExcelWriter, self).__init__(path)

class ExcelFile(excel.ExcelFile):
def __init__(self, path_or_buf, kind=None, **kwds):
def __init__(self, path_or_buf, **kwds):
warn("ExcelFile can now be imported from: pandas.io.excel", FutureWarning)
super(ExcelFile, self).__init__(path_or_buf, kind=kind, **kwds)
super(ExcelFile, self).__init__(path_or_buf, **kwds)