8000 REG: read_excel with engine specified raises on non-path/non-buffer by rhshadrach · Pull Request #39586 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REG: read_excel with engine specified raises on non-path/non-buffer #39586

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 11 commits into from
Feb 7, 2021
Prev Previous commit
Next Next commit
Only mark as xfail for read-only cases
  • Loading branch information
rhshadrach committed Feb 6, 2021
commit 33acfaa19077248e04a0ffa0be5ab82aa3b5ee36
12 changes: 7 additions & 5 deletions pandas/tests/io/excel/test_openpyxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,16 @@ def test_read_workbook(datapath, ext, read_only):
)
# When read_only is None, use read_excel instead of a workbook
@pytest.mark.parametrize("read_only", [True, False, None])
@pytest.mark.xfail(
LooseVersion(get_version(openpyxl)) < "3.0.0",
reason="openpyxl read-only sheet is incorrect when dimension data is wrong",
)
def test_read_with_bad_dimension(
datapath, ext, header, expected_data, filename, read_only
datapath, ext, header, expected_data, filename, read_only, request
):
# GH 38956, 39001 - no/incorrect dimension information
version = LooseVersion(get_version(openpyxl))
if (read_only or read_only is None) and version < "3.0.0":
msg = "openpyxl read-only sheet is incorrect when dimension data is wrong"
request.node.add_marker(
pytest.mark.xfail(LooseVersion(get_version(openpyxl)) < "3.0.0", reason=msg)
)
path = datapath("io", "data", "excel", f"{filename}{ext}")
if read_only is None:
result = pd.read_excel(path, header=header)
Expand Down
0