Skip to content

BUG: read_excel with openpyxl produces trailing rows of nan #39547

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 26 commits into from
Feb 8, 2021
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2bcf35b
BUG: read_excel with openpyxl and missing dimension
rhshadrach Jan 30, 2021
ea18d61
fixups
rhshadrach Jan 30, 2021
d5215f7
Added fixes for incorrect dimension information
rhshadrach Jan 31, 2021
d6c3af1
Return "" for null date columns, trim empty trailing rows
rhshadrach Jan 31, 2021
c51340c
whatsnew
rhshadrach Jan 31, 2021
8cd7aad
Removed fix for 39181
rhshadrach Feb 1, 2021
7ed5c36
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 1, 2021
b70b65d
BUG: read_excel with openpyxl produces trailing rows of nan
rhshadrach Feb 1, 2021
ea150b3
Add test excel file
rhshadrach Feb 1, 2021
b887183
REG: read_excel with engine specified raises on non-path/non-buffer
rhshadrach Feb 3, 2021
2291988
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 3, 2021
601ad87
Restore special-casing for xlrd.Book even when engine is None
rhshadrach Feb 3, 2021
d835dff
GH # in test
rhshadrach Feb 3, 2021
e6684e9
Added wb.close() to test
rhshadrach Feb 4, 2021
1f16602
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 5, 2021
ba2bc75
Added logic/tests for determining if a sheet is read-only
rhshadrach Feb 5, 2021
1381ecc
Added comment
rhshadrach Feb 5, 2021
a3db3eb
Combine and reorg tests
rhshadrach Feb 5, 2021
becd2cf
-
rhshadrach Feb 5, 2021
41e8b81
Merge branch 'openpyxl_workbook' of https://github.com/rhshadrach/pan…
rhshadrach Feb 5, 2021
d773418
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 7, 2021
a3b6369
Added xlsx test file
rhshadrach Feb 7, 2021
e9f6fa2
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 7, 2021
3e9bd4f
xfail and improve tests
rhshadrach Feb 8, 2021
b5d662b
Merge branch 'master' of https://github.com/pandas-dev/pandas into op…
rhshadrach Feb 8, 2021
8773c32
Merge branch 'master' into openpyxl_nans
simonjayhawkins Feb 8, 2021
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
Prev Previous commit
Next Next commit
…enpyxl_nans

� Conflicts:
�	pandas/tests/io/excel/test_openpyxl.py
  • Loading branch information
rhshadrach committed Feb 7, 2021
commit e9f6fa262dc10d8e315e3103031f0d6106f9b130
19 changes: 19 additions & 0 deletions pandas/tests/io/excel/test_openpyxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,25 @@ def test_read_with_bad_dimension(
tm.assert_frame_equal(result, expected)


def test_append_mode_file(ext):
# GH 39576
df = DataFrame()

with tm.ensure_clean(ext) as f:
df.to_excel(f, engine="openpyxl")

with ExcelWriter(f, mode="a", engine="openpyxl") as writer:
df.to_excel(writer)

# make sure that zip files are not concatenated by making sure that
# "docProps/app.xml" only occurs twice in the file
data = Path(f).read_bytes()
first = data.find(b"docProps/app.xml")
second = data.find(b"docProps/app.xml", first + 1)
third = data.find(b"docProps/app.xml", second + 1)
assert second != -1 and third == -1


def test_read_with_empty_trailing_rows(datapath, ext):
# GH 39181
path = datapath("io", "data", "excel", f"empty_trailing_rows{ext}")
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.