Skip to content

Preserve parent categories in PowerPoint chart tables - #2503

Open
Kunpeng Xie (pentaoa) wants to merge 1 commit into
microsoft:mainfrom
pentaoa:fix/pptx-category-hierarchy
Open

Kunpeng Xie (pentaoa) wants to merge 1 commit into
microsoft:mainfrom
pentaoa:fix/pptx-category-hierarchy

Conversation

@pentaoa

Copy link
Copy Markdown

Fixes #2502.

PowerPoint charts grouped by year and quarter currently emit repeated Q1 rows without the years. Read python-pptx's flattened_labels and 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 and git 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PPTX chart conversion drops parent category labels

1 participant