Skip to content

fix(pptx): degrade an area3DChart to a picture instead of failing the deck - #4380

Closed
chrikrah wants to merge 1 commit into
docling-project:mainfrom
chrikrah:fix/pptx-area3d-chart-crash
Closed

chrikrah wants to merge 1 commit into
docling-project:mainfrom
chrikrah:fix/pptx-area3d-chart-crash

Conversation

@chrikrah

Copy link
Copy Markdown
Contributor

docling/backend/mspowerpoint_backend.py:1156 catches (AttributeError, ValueError, KeyError) around _chart_to_table_data. python-pptx raises NotImplementedError for c:area3DChart. That is the one plot element with both an element class and a plot class registered and no series class. One such chart loses the whole deck.

Input: a python-pptx two-dimensional area chart whose c:areaChart is retagged c:area3DChart in the zip.

Before:

NotImplementedError: series class for ...area3DChart not yet implemented
RuntimeError: Pipeline SimplePipeline failed

The text on the other slide goes with it.

After: one PictureItem, tabular_chart is None, and the sibling text intact. c:bar3DChart already degrades that way, from #3972.

Issue #3970 is closed, and its own text predicts this residue.

Verification

28 passed, 2 skipped, 4 warnings in 3.19s

Revert mspowerpoint_backend.py alone and keep the test:

1 failed, 27 passed, 2 skipped

ruff check and ruff format --check are clean. No file under tests/data/ changes.

python-pptx registers both an element class and a plot class for
`c:area3DChart`, but no series class, so reading its series raises
`NotImplementedError`. The other 3-D plots raise `ValueError` or
`AttributeError` from `chart.chart_type`, which the guard above already
catches, so `c:area3DChart` was the one chart type whose failure escaped
`_handle_chart` and aborted the conversion of the whole presentation.

Catch it where the other failures are caught, so the chart degrades to a
classified picture without tabular data, exactly as `c:bar3DChart` does.

Signed-off-by: chrikrah <48338417+chrikrah@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @chrikrah, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dolfim-ibm

Copy link
Copy Markdown
Member

Thanks a lot @chrikrah. This was the first PR to identify and fix the c:area3DChart failure, where one such chart made the whole deck fail. The reproduction and the before/after evidence in the description were very helpful.

We will continue with #4811 for this fix. It handles the same area3DChart case, but it reads the chart series, so the chart keeps its tabular_chart data instead of becoming a picture without data. It also covers the other 3-D, stock, surface and bar-of-pie plots in the same change, and it has regression tests.

The credit for finding this issue is yours, and it is recorded in #4811 too. Closing this PR as superseded by #4811. Thank you for the contribution, and we hope to see more PRs from you.

@dolfim-ibm dolfim-ibm closed this Oct 19, 2026
@chrikrah
chrikrah deleted the fix/pptx-area3d-chart-crash branch October 22, 2026 04:38
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.

2 participants