Preserve parent categories in PowerPoint chart tables - #2503
Open
Kunpeng Xie (pentaoa) wants to merge 1 commit into
Open
Kunpeng Xie (pentaoa) wants to merge 1 commit into
Kunpeng Xie (pentaoa) wants to merge 1 commit into
Conversation
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 #2502.
PowerPoint charts grouped by year and quarter currently emit repeated
Q1rows without the years. Read python-pptx'sflattened_labelsand retain the parent-to-child path in the Category cell (2024 / Q1), preserving row order and series values. Flat text and numeric categories keep their existing output.The new tests save real PPTX files in memory and convert them through
MarkItDown.convert_stream. They cover unequal parent group sizes, two and three category levels, multiple series, and flat categories. The two hierarchical cases fail on main; all 21 selected PPTX tests pass with the fix, including existing chart title, multi-series, notes, and image tests. Updated the two chart-title mocks to expose the category API now used by the converter.Validation:
pytest packages/markitdown/tests/test_pptx_*.py packages/markitdown/tests/test_module_misc.py -k pptx -q(21 passed); Black andgit diff --check. No new dependencies or binary fixtures. The full multi-format suite was not run.Prepared with AI assistance; the reproduction and tests were run locally.