Skip to content

chore(pdf): remove two orphaned region helpers from pdfminer_processing - #4839

Open
KRRT7 wants to merge 1 commit into
Unstructured-IO:mainfrom
KRRT7:chore/remove-orphaned-pdfminer-region-helpers
Open

KRRT7 wants to merge 1 commit into
Unstructured-IO:mainfrom
KRRT7:chore/remove-orphaned-pdfminer-region-helpers

Conversation

@KRRT7

@KRRT7 KRRT7 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two functions in unstructured/partition/pdf_image/pdfminer_processing.py have no callers anywhere in the library, tests or scripts:

  • _create_text_region(), which scaled coordinates and built a single text region.
  • pdfminer_elements_to_text_regions(), which converted LayoutElements into a list of EmbeddedTextRegion / ImageTextRegion objects. Its docstring calls it "a temporary solution" until the merging logic was refactored.

Both lost their last callers when layout merging moved to the vectorized TextRegions / LayoutElements structures (#3881, #3900). Coverage over the full test suite confirms neither ever runs.

This PR deletes both. Nothing else in the module changes: Source, LayoutElements and TextRegions are still used elsewhere.

Behavior

Unchanged: the removed code was unreachable.

Validation

View guided diff

`_create_text_region()` and `pdfminer_elements_to_text_regions()` have no
callers in the library, tests or scripts. They lost their last callers when
layout merging moved to the vectorized `TextRegions`/`LayoutElements`
structures (Unstructured-IO#3881, Unstructured-IO#3900); `pdfminer_elements_to_text_regions` describes itself
as "a temporary solution" pending that refactor. Coverage over the full test
suite shows neither ever runs.

This branch has not been deployed

No deployments
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.

1 participant