Skip to content
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
3 changes: 2 additions & 1 deletion pandas-stubs/io/excel/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ class ExcelFile:
io: FilePath | ReadBuffer[bytes] | bytes = ...
def __init__(
self,
io: FilePath | ReadBuffer[bytes] | bytes,
path_or_buffer: FilePath | ReadBuffer[bytes] | bytes,
engine: ExcelReadEngine | None = ...,
storage_options: StorageOptions = ...,
engine_kwargs: dict[str, Any] | None = ...,
) -> None: ...
def __fspath__(self): ...
@overload
Expand Down
8 changes: 8 additions & 0 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,14 @@ def test_excel_reader():
check(assert_type(ef, pd.ExcelFile), pd.ExcelFile)
check(assert_type(pd.read_excel(ef), pd.DataFrame), pd.DataFrame)

with pd.ExcelFile(
path_or_buffer=path,
engine="openpyxl",
engine_kwargs={"data_only": True},
) as ef:
check(assert_type(ef, pd.ExcelFile), pd.ExcelFile)
check(assert_type(pd.read_excel(ef), pd.DataFrame), pd.DataFrame)


def test_excel_writer():
with ensure_clean(".xlsx") as path:
Expand Down