From f789cb973cc7c849211ad184a1e1ee782b4f8487 Mon Sep 17 00:00:00 2001 From: Pacific <12509045+pacificdragon@users.noreply.github.com> Date: Wed, 8 Feb 2023 00:33:08 +0530 Subject: [PATCH 1/2] Removed **kwds from parse function in read_excel --- pandas/io/excel/_base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 2a0d3a01d3383..3476de6bd20ba 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -1538,13 +1538,16 @@ def parse( skiprows: Sequence[int] | int | Callable[[int], object] | None = None, nrows: int | None = None, na_values=None, + keep_default_na: bool = True, + na_filter: bool = True, + verbose: bool = False, parse_dates: list | dict | bool = False, date_parser: Callable | None = None, thousands: str | None = None, comment: str | None = None, + decimal: str = ".", skipfooter: int = 0, use_nullable_dtypes: bool = False, - **kwds, ) -> DataFrame | dict[str, DataFrame] | dict[int, DataFrame]: """ Parse specified sheet(s) into a DataFrame. @@ -1570,13 +1573,16 @@ def parse( skiprows=skiprows, nrows=nrows, na_values=na_values, + keep_default_na=keep_default_na, + na_filter=na_filter, + verbose=verbose, parse_dates=parse_dates, date_parser=date_parser, thousands=thousands, + decimal=decimal, comment=comment, skipfooter=skipfooter, use_nullable_dtypes=use_nullable_dtypes, - **kwds, ) @property From 84204fe3f06f7e695d26600989300efcd4406b23 Mon Sep 17 00:00:00 2001 From: Pacific <12509045+pacificdragon@users.noreply.github.com> Date: Wed, 8 Feb 2023 00:36:46 +0530 Subject: [PATCH 2/2] Added details of the change --- doc/source/whatsnew/v2.0.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 9df0fd4f26b2c..6c85140117686 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -1255,6 +1255,7 @@ I/O - Bug in :meth:`DataFrame.to_dict` not converting ``NA`` to ``None`` (:issue:`50795`) - Bug in :meth:`DataFrame.to_json` where it would segfault when failing to encode a string (:issue:`50307`) - Bug in :func:`read_xml` where file-like objects failed when iterparse is used (:issue:`50641`) +- Bug in :func:`read_excel` where passing invalid argument name ``headers`` to :meth:`parse` doesn't raise error (:issue:`50953`) Period ^^^^^^