Closed
Description
Describe the bug
Need support engine="xlsxwriter"
for ExcelWriter
To Reproduce
import pandas as pd
DF = pd.DataFrame({"a": [1, 2, 3], "b": [0.0, 0.0, 0.0]})
with pd.ExcelWriter("tmp.xlsx", mode="w", engine="xlsxwriter") as ew:
DF.to_excel(ew, sheet_name="A")
pyright reports
ew.py
c:\Code\pandas-stubs\ew.py:5:50 - error: Argument of type "Literal['xlsxwriter']" cannot be assigned to parameter "engine" of type "Literal['auto', 'openpyxl', 'pyxlsb', 'odf'] | None" in function "__init__"
Type "Literal['xlsxwriter']" cannot be assigned to type "Literal['auto', 'openpyxl', 'pyxlsb', 'odf'] | None"
Type cannot be assigned to type "None"
"Literal['xlsxwriter']" cannot be assigned to type "Literal['auto']"
"Literal['xlsxwriter']" cannot be assigned to type "Literal['openpyxl']"
"Literal['xlsxwriter']" cannot be assigned to type "Literal['pyxlsb']"
"Literal['xlsxwriter']" cannot be assigned to type "Literal['odf']" (reportGeneralTypeIssues)
Please complete the following information:
- OS: Windows 10
- python version: 3.9
- version of type checker: pyright 1.1.283
- version of installed
pandas-stubs
1.5.2.221124
Additional context
Need to add "xlsxwriter"
to:
pandas-stubs/pandas-stubs/io/excel/_base.pyi
Line 107 in 58416f2
When creating a test, have to update pyproject.toml
to install xlsxwriter
for that test