diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 53581420f920f..2bccaa1a4e322 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -1297,6 +1297,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 ^^^^^^ diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 79d174db5c0a7..074b1cf554680 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -1539,13 +1539,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. @@ -1571,13 +1574,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