Skip to content
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

Doc: Fix GL08 error for pandas.ExcelFile.book #57807

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (GL08)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL08 --ignore_functions \
pandas.ExcelFile.book\
pandas.Index.empty\
pandas.Index.names\
pandas.Index.view\
Expand Down
26 changes: 26 additions & 0 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,32 @@ def parse(

@property
def book(self):
"""
Gets the Excel workbook.

Workbook is the top-level container for all document information.

Returns
-------
Excel Workbook
The workbook object of the type defined by the engine being used.

See Also
--------
read_excel : Read an Excel file into a pandas DataFrame.

Examples
--------
>>> file = pd.ExcelFile("myfile.xlsx") # doctest: +SKIP
>>> file.book # doctest: +SKIP
<openpyxl.workbook.workbook.Workbook object at 0x11eb5ad70>
>>> file.book.path # doctest: +SKIP
'/xl/workbook.xml'
>>> file.book.active # doctest: +SKIP
<openpyxl.worksheet._read_only.ReadOnlyWorksheet object at 0x11eb5b370>
>>> file.book.sheetnames # doctest: +SKIP
['Sheet1', 'Sheet2']
"""
return self._reader.book

@property
Expand Down