Skip to content

Conversation

@Fidorc80
Copy link

Removed usage of the @Appender and @doc decorators for read_excel and storage_options, replacing them with inline docstrings for pandas/io/excel/_base.py.

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.
  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

@Fidorc80 Fidorc80 requested a review from rhshadrach as a code owner November 24, 2025 17:06
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment on lines 1003 to 1004
storage_options : dict, optional
Extra options that make sense for a particular storage connection, e.g.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this and the two instance below, can you indent the body description as is done for other parameters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, sorry I got busy and am just now getting back to work on the failing checks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated this as asked for, I am still failing two checks, but I am unsure why, I copied the docstrings as suggested originally and I have only made linting and requested changes since then, any advice would be appreciated!

@rhshadrach rhshadrach added Docs IO Excel read_excel, to_excel labels Nov 25, 2025
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just an indentation issue.

Comment on lines 367 to 369
If used in conjunction with ``parse_dates``, will parse dates according to this
format. For anything more complex,
please read in as ``object`` and then apply :func:`to_datetime` as-needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs indenting

@Fidorc80
Copy link
Author

Fidorc80 commented Dec 3, 2025

Thanks for the help!

It looks like I worked through the formatting issues and only have 1 failing check which is for date_parser a deprecated parameter.

image

How should I proceed from here?

@rhshadrach
Copy link
Member

@Fidorc80 - that parameter was deprecated in 2.x and is now removed on main. You should be taking the docstring from the main branch, not 2.x.

https://pandas.pydata.org/docs/dev/reference/api/pandas.read_excel.html

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing that this PR is losing various changes that have been made to the docstring over the last 2 years.

engine_kwargs: dict | None = None,
) -> DataFrame | dict[IntStrT, DataFrame]:
"""
Read an Excel file into a ``pandas`` ``DataFrame``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``pandas`` is not in the current version of the docs. Can you remove.

Parameters
----------
io : str, bytes, ExcelFile, xlrd.Book, path object, or file-like object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

Strings are used for sheet names. Integers are used in zero-indexed
sheet positions (chart sheets do not count as a sheet position).
Lists of strings/integers are used to request multiple sheets.
Specify ``None`` to get all worksheets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

* ``"Sheet1"``: Load sheet with name "Sheet1"
* ``[0, 1, "Sheet5"]``: Load first, second and sheet named "Sheet5"
as a dict of `DataFrame`
* ``None``: All worksheets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

False otherwise. An example of a valid callable argument would be ``lambda
x: x in [0, 2]``.
nrows : int, default None
Number of rows to parse.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

<https://pandas.pydata.org/docs/user_guide/io.html?
highlight=storage_options#reading-writing-remote-files>`_.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

(still experimental). Behaviour is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs to be updated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I am unsure what I did to get where I am, as I felt I was working off of the current main. I will reevaluate what I have going on, fix it and resubmit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs IO Excel read_excel, to_excel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants