Skip to content

Commit 3a3016c

Browse files
committed
Add test for read_excel engine
1 parent c5f8ef2 commit 3a3016c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

pandas-stubs/io/excel/_base.pyi

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ from pandas._typing import (
3535
WriteExcelBuffer,
3636
)
3737

38-
ReadEngine: TypeAlias = Literal["xlrd", "openpyxl", "odf", "pyxlsb", "calamine"]
38+
ReadEngine: TypeAlias = Literal["xlrd", "openpyxl", "odf", "pyxlsb", "calamine"]
3939

4040
@overload
4141
def read_excel(
@@ -207,8 +207,7 @@ def read_excel(
207207
dtype_backend: DtypeBackend | NoDefault = ...,
208208
) -> DataFrame: ...
209209

210-
211-
WriteEngine: TypeAlias = Literal["openpyxl", "odf", "xlsxwriter"]
210+
WriteEngine: TypeAlias = Literal["openpyxl", "odf", "xlsxwriter"]
212211

213212
class ExcelWriter:
214213
def __init__(

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ SQLAlchemy = ">=2.0.12"
6464
types-python-dateutil = ">=2.8.19"
6565
beautifulsoup4 = ">=4.12.2"
6666
html5lib = ">=1.1"
67+
python-calamine = "0.2.0"
6768

6869
[build-system]
6970
requires = ["poetry-core>=1.0.0"]

tests/test_io.py

+10
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,16 @@ def test_read_excel() -> None:
961961
),
962962
pd.DataFrame,
963963
)
964+
check(
965+
assert_type(
966+
pd.read_excel(
967+
path,
968+
engine="calamine",
969+
),
970+
pd.DataFrame,
971+
),
972+
pd.DataFrame,
973+
)
964974
if TYPE_CHECKING_INVALID_USAGE:
965975
pd.read_excel(path, names="abcd") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
966976

0 commit comments

Comments
 (0)