Skip to content

Commit

Permalink
DEPR: deprecate non keyword arguments to read_excel (#34418)
Browse files Browse the repository at this point in the history
  • Loading branch information
topper-123 committed May 29, 2020
1 parent 83d3c4c commit 043b609
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 163 deletions.
4 changes: 4 additions & 0 deletions doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,10 @@ Deprecations
version 1.1. All other arguments should be given as keyword
arguments (:issue:`27573`).

- Passing any arguments but the first 2 to :func:`read_excel` as
positional arguments is deprecated since version 1.1. All other
arguments should be given as keyword arguments (:issue:`27573`).

- :func:`pandas.api.types.is_categorical` is deprecated and will be removed in a future version; use `:func:pandas.api.types.is_categorical_dtype` instead (:issue:`33385`)
- :meth:`Index.get_value` is deprecated and will be removed in a future version (:issue:`19728`)
- :meth:`Series.dt.week` and `Series.dt.weekofyear` are deprecated and will be removed in a future version, use :meth:`Series.dt.isocalendar().week` instead (:issue:`33595`)
Expand Down
3 changes: 2 additions & 1 deletion pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pandas._libs.parsers import STR_NA_VALUES
from pandas.errors import EmptyDataError
from pandas.util._decorators import Appender
from pandas.util._decorators import Appender, deprecate_nonkeyword_arguments

from pandas.core.dtypes.common import is_bool, is_float, is_integer, is_list_like

Expand Down Expand Up @@ -266,6 +266,7 @@
)


@deprecate_nonkeyword_arguments(allowed_args=2, version="2.0")
@Appender(_read_excel_doc)
def read_excel(
io,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/excel/test_odf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_read_writer_table():
columns=["Column 1", "Unnamed: 2", "Column 3"],
)

result = pd.read_excel("writertable.odt", "Table1", index_col=0)
result = pd.read_excel("writertable.odt", sheet_name="Table1", index_col=0)

tm.assert_frame_equal(result, expected)

Expand Down
Loading

0 comments on commit 043b609

Please sign in to comment.