From 21d454da45e626a518c42a39143faad0003e0acb Mon Sep 17 00:00:00 2001 From: Jeffrey Tratner Date: Fri, 30 Aug 2013 18:15:17 -0400 Subject: [PATCH] CLN: Remove unused and undocumented kind keyword from public API --- pandas/io/excel.py | 13 ++++++++----- pandas/io/parsers.py | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandas/io/excel.py b/pandas/io/excel.py index 534a88e303dbf..4f998b49260e6 100644 --- a/pandas/io/excel.py +++ b/pandas/io/excel.py @@ -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 @@ -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): @@ -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 diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 3b132be800cb1..8cf7eaa1b19e3 100644 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -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)