fzumstein / python-for-excel

This is the companion repo of the O'Reilly book "Python for Excel".
https://www.xlwings.org/book
MIT License
557 stars 296 forks source link

FutureWarning with latest version of pandas in sales_report_openpyxl.py #8

Closed fzumstein closed 2 years ago

fzumstein commented 2 years ago
~\python-for-excel-1st-edition\sales_report_openpyxl.py:48: FutureWarning: Use of **kwargs is deprecated, use engine_kwargs instead.
fzumstein commented 2 years ago

Since pandas 1.3.0 (Anaconda 2021-11), the way to go is to write

with pd.ExcelWriter(this_dir / "sales_report_openpyxl.xlsx",
                    engine="openpyxl", engine_kwargs={"write_only": True}) as writer:

instead of

with pd.ExcelWriter(this_dir / "sales_report_openpyxl.xlsx",
                    engine="openpyxl", write_only=True) as writer:

here: https://github.com/fzumstein/python-for-excel/blob/1st-edition/sales_report_openpyxl.py#L48-L49