You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with openpyxl 2.2.0, various tests in pandas.io.tests.test_excel fail with tracebacks similar to this one.
======================================================================
ERROR: test_basics_with_nan (pandas.io.tests.test_excel.Openpyxl2Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pandas/io/tests/test_excel.py", line 1229, in wrapped
orig_method(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pandas/io/tests/test_excel.py", line 641, in test_basics_with_nan
self.frame.to_excel(path, 'test1')
File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 1267, in to_excel
startrow=startrow, startcol=startcol)
File "/usr/local/lib/python2.7/site-packages/pandas/io/excel.py", line 778, in write_cells
xcell.style = xcell.style.copy(**style_kwargs)
File "/usr/local/lib/python2.7/site-packages/openpyxl/styles/styleable.py", line 107, in style
protection=self.protection
File "/usr/local/lib/python2.7/site-packages/openpyxl/styles/__init__.py", line 42, in __init__
self._font = font
File "/usr/local/lib/python2.7/site-packages/openpyxl/descriptors/base.py", line 35, in __set__
raise TypeError('expected ' + str(self.expected_type))
TypeError: expected <class 'openpyxl.styles.fonts.Font'>
pandas.io.excel._Openpyxl2Writer.write_cells uses openpyxl.styles.Style.copy to merge newly specified style data with style data on existing cells. Sadly, the obvious workaround—iterate over the fields of the Style object and use them to build an updated Style object—won't work either without additional coddling, because the fields don't reliably return the native object that the Style constructor demands.
Starting with openpyxl 2.2.0, various tests in
pandas.io.tests.test_excel
fail with tracebacks similar to this one.pandas.io.excel._Openpyxl2Writer.write_cells
usesopenpyxl.styles.Style.copy
to merge newly specified style data with style data on existing cells. Sadly, the obvious workaround—iterate over the fields of theStyle
object and use them to build an updatedStyle
object—won't work either without additional coddling, because the fields don't reliably return the native object that theStyle
constructor demands.(See upstream issue: 444 copy() method on Style object raises TypeError)
The text was updated successfully, but these errors were encountered: