Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: xlwt for writing excel files #38317

Merged
merged 5 commits into from Dec 8, 2020

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Dec 5, 2020

  • closes Deprecate xlwt #26552
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Deprecates both specifying engine="xlwt" and the option io.excel.xls.writer. Note that a warning is emitted when a user sets the io.excel.xls.writer option, but not via the context manager. Whatsnew now reads:

image

@rhshadrach rhshadrach added Deprecate Functionality to remove in pandas IO Excel read_excel, to_excel labels Dec 5, 2020
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

The `xlwt <https://pypi.org/project/xlwt/>`__
engine, the only engine that supports writing
in an xls format, is no longer maintained and
will be removed in a future version of pandas.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: it's the package that is no longer maintained, and the engine that will be removed (now it reads like the code in pandas that will be removed is no longer maintained)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(now, since it's written this way in many places in your PR (and the previous one), it might not be worth it to change ..)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the nitpicks; and as long as it's not holding things up happy to work on it to get it right. What do you think of:

The `xlwt <https://pypi.org/project/xlwt/>`__ package is no longer maintained and will not be available in a future version of pandas. This is the only engine currently in pandas that supports writing in an xls format.

"an xls format, is no longer maintained and will be removed in "
"a future version of pandas. Install openpyxl and write to an "
"xlsx file instead. You can set the option "
"io.excel.xls.writer to 'xlwt' to silence this warning.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But setting the option is also deprecated and will also raise a warning?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - but at least it is in hopefully fewer places in user code. The warning can still be ignored there, but I see now that will cause confusion when a user follows the instruction and then still gets a warning. I'm thinking I'll change to:

You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. This option is deprecated as well and will also give a warning, but can be globally set and suppressed.

@jreback jreback added this to the 1.2 milestone Dec 7, 2020
@jreback
Copy link
Contributor

jreback commented Dec 7, 2020

looks ok to me (ex text comments). ping when revised.

@rhshadrach
Copy link
Member Author

Thanks @jorisvandenbossche and @jreback, changes made. I also updated the screenshot in the OP.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!

@jorisvandenbossche jorisvandenbossche merged commit 37f7bdc into pandas-dev:master Dec 8, 2020
@rhshadrach rhshadrach deleted the dep_xlwt branch January 2, 2021 14:15
@mroeschke mroeschke mentioned this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate xlwt
3 participants