-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
DOC: inline docstrings for read_excel and storage options in io/excel… #63193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rhshadrach
left a comment
There was a problem hiding this 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!
pandas/io/excel/_base.py
Outdated
| storage_options : dict, optional | ||
| Extra options that make sense for a particular storage connection, e.g. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this 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.
pandas/io/excel/_base.py
Outdated
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs indenting
|
@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 |
rhshadrach
left a comment
There was a problem hiding this 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.
pandas/io/excel/_base.py
Outdated
| engine_kwargs: dict | None = None, | ||
| ) -> DataFrame | dict[IntStrT, DataFrame]: | ||
| """ | ||
| Read an Excel file into a ``pandas`` ``DataFrame``. |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| Parameters | ||
| ---------- | ||
| io : str, bytes, ExcelFile, xlrd.Book, path object, or file-like object |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| 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. |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| * ``"Sheet1"``: Load sheet with name "Sheet1" | ||
| * ``[0, 1, "Sheet5"]``: Load first, second and sheet named "Sheet5" | ||
| as a dict of `DataFrame` | ||
| * ``None``: All worksheets. |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| 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. |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| <https://pandas.pydata.org/docs/user_guide/io.html? | ||
| highlight=storage_options#reading-writing-remote-files>`_. | ||
| dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| (still experimental). Behaviour is as follows: | ||
| * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` | ||
| (default). |
There was a problem hiding this comment.
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.
pandas/io/excel/_base.py
Outdated
| dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' | ||
| Back-end data type applied to the resultant :class:`DataFrame` | ||
| (still experimental). Behaviour is as follows: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.

Removed usage of the
@Appenderand@docdecorators for read_excel and storage_options, replacing them with inline docstrings for pandas/io/excel/_base.py.doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.AGENTS.md.