Skip to content

CI: troubleshoot openpyxl failures #30009

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

Merged
merged 3 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/deps/travis-36-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies:
- numexpr
- numpy=1.15.*
- odfpy
- openpyxl
- openpyxl<=3.0.1
# https://github.com/pandas-dev/pandas/pull/30009 openpyxl 3.0.2 broke
- pandas-gbq
# https://github.com/pydata/pandas-gbq/issues/271
- google-cloud-bigquery<=1.11
Expand Down
12 changes: 11 additions & 1 deletion pandas/tests/io/excel/test_openpyxl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from distutils.version import LooseVersion
import os

import numpy as np
import pytest

from pandas.compat import PY37, is_platform_mac

import pandas as pd
from pandas import DataFrame
import pandas.util.testing as tm
Expand All @@ -13,6 +16,8 @@

pytestmark = pytest.mark.parametrize("ext", [".xlsx"])

openpyxl_gt301 = LooseVersion(openpyxl.__version__) > LooseVersion("3.0.1")


def test_to_excel_styleconverter(ext):
from openpyxl import styles
Expand Down Expand Up @@ -81,6 +86,9 @@ def test_write_cells_merge_styled(ext):
assert xcell_a2.font == openpyxl_sty_merged


@pytest.mark.xfail(
openpyxl_gt301 and PY37 and is_platform_mac(), reason="broken change in openpyxl"
)
@pytest.mark.parametrize(
"mode,expected", [("w", ["baz"]), ("a", ["foo", "bar", "baz"])]
)
Expand All @@ -107,7 +115,9 @@ def test_write_append_mode(ext, mode, expected):
assert wb2.worksheets[index]["A1"].value == cell_value


@pytest.mark.xfail(openpyxl.__version__ > "3.0.1", reason="broken change in openpyxl")
@pytest.mark.xfail(
openpyxl_gt301 and PY37 and is_platform_mac(), reason="broken change in openpyxl"
)
def test_to_excel_with_openpyxl_engine(ext, tmpdir):
# GH 29854
# TODO: Fix this once newer version of openpyxl fixes the bug
Expand Down