fix(xlsx): tolerate legacy showZeroes sheet views - #2064
Merged
Conversation
Contributor
Author
|
Friendly ping for maintainer review. The CLA check is green, and the current patch is limited to the openpyxl showZeroes compatibility fallback plus a regression test. Please let me know if you want the compatibility path shaped differently. |
There was a problem hiding this comment.
🟡 Changes recommended
The unrestricted byte replacement can silently modify inline worksheet cell values.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds XLSX compatibility handling for legacy showZeroes worksheet attributes.
Changes:
- Retries XLSX parsing after an in-memory worksheet XML repair.
- Adds an end-to-end regression test for legacy workbooks.
File summaries
| File | Description |
|---|---|
_xlsx_converter.py |
Implements compatibility fallback and retry. |
test_module_misc.py |
Tests legacy workbook conversion. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2063.
Some XLSX files still contain the worksheet view attribute name
showZeroes. openpyxl 3.1+ expectsshowZeros, so loading those files raises a TypeError before MarkItDown can read the workbook.This keeps the normal pandas/openpyxl path unchanged. If that path fails with the known
showZeroesTypeError, MarkItDown rewrites worksheet XML entries in memory fromshowZeroestoshowZerosand retries the read. The fallback is scoped to worksheet XML files and only runs for that specific compatibility error.Validation: