Skip to content

COMPAT: openpyxl deprecation warnings #15090

@jreback

Description

@jreback

other issues about warnings
xref #14519
xref #14539

tons of warnings on openpyxl 2.4.0 (this is under 3.5), but we have the latest on lots of travis builds.

so need to fix these based on the version, IOW. have a function that introspects the version then does a) if < 2.4.0 (or whatever version triggers these), else does the the new thing.

(pandas) bash-3.2$ nosetests pandas/io/tests/test_excel.py  -v
test_ExcelWriter_dispatch (pandas.io.tests.test_excel.ExcelWriterEngineTests) ... /Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/xlwt/ExcelFormulaLexer.py:53: DeprecationWarning: LOCALE flag with a str pattern is deprecated. Will be an error in 3.6
  VERBOSE+LOCALE+IGNORECASE)
ok
test_register_writer (pandas.io.tests.test_excel.ExcelWriterEngineTests) ... ok
SKIP: openpyxl 2.4.0 >= 2.2
test_basics_with_nan (pandas.io.tests.test_excel.Openpyxl22Tests) ... /Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
/Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
/Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
/Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
ok
test_bool_types (pandas.io.tests.test_excel.Openpyxl22Tests) ... /Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
/Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
ok
test_bytes_io (pandas.io.tests.test_excel.Openpyxl22Tests) ... /Users/jreback/miniconda3/envs/pandas/lib/python3.5/site-packages/openpyxl/workbook/workbook.py:179: DeprecationWarning: Call to deprecated function or class remove_sheet (Use wb.remove(worksheet) or del wb[sheetname]).
  def remove_sheet(self, worksheet):
ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsIO Excelread_excel, to_excel

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions