Skip to content

Commit ddccc56

Browse files
authored
GH1061 add calamine literal to ExcelFile engine (#1062)
* GH1061 add calamine literal to ExcelFile engine * fix format
1 parent d3fcc64 commit ddccc56

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pandas-stubs/io/excel/_base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class ExcelFile:
246246
def __init__(
247247
self,
248248
io: FilePath | ReadBuffer[bytes] | bytes,
249-
engine: Literal["xlrd", "openpyxl", "odf", "pyxlsb"] | None = ...,
249+
engine: ExcelReadEngine | None = ...,
250250
storage_options: StorageOptions = ...,
251251
) -> None: ...
252252
def __fspath__(self): ...

tests/test_io.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,14 @@ def test_read_excel_dtypes():
11091109
check(assert_type(read_excel(path, dtype=dtypes), pd.DataFrame), pd.DataFrame)
11101110

11111111

1112+
def test_excel_reader():
1113+
with ensure_clean(".xlsx") as path:
1114+
check(assert_type(DF.to_excel(path), None), type(None))
1115+
with pd.ExcelFile(path, engine="calamine") as ef:
1116+
check(assert_type(ef, pd.ExcelFile), pd.ExcelFile)
1117+
check(assert_type(pd.read_excel(ef), pd.DataFrame), pd.DataFrame)
1118+
1119+
11121120
def test_excel_writer():
11131121
with ensure_clean(".xlsx") as path:
11141122
with pd.ExcelWriter(path) as ew:

0 commit comments

Comments
 (0)