Unstructured-IO / Unstructured-IO/unstructured
bug/<partition returns empty output and exits with code 0>
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 15.5k
- Forks
- 1.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 13
Description
Describe the bug
When using the partition function from unstructured.partition.auto to process a PDF file (embedded-images.pdf), the program finishes execution with exit code 0 but produces no output. Expected behavior is to see extracted content printed, but there's nothing returned.
To Reproduce
code:
from unstructured.partition.auto import partition
elements = partition("./example-docs/pdf/embedded-images.pdf")
print("\n\n".join([str(el) for el in elements]))
Ensure the ./example-docs/pdf/embedded-images.pdf file exists and is accessible.
Run the script. Observe that there's no output, and the process exits with code 0.
Expected behavior
The partition function should extract content (text, image metadata, etc.) from the PDF and the print statement should output the joined string representation of the extracted elements, showing relevant information like text blocks, image details, etc.
Additional context
Tried with different PDF files (simple text-only PDFs, other PDFs with images) and got the same silent exit with code 0 result in some cases, which makes me think there might be an issue with the partition function's handling of certain PDF structures or a potential bug in the auto-partition logic.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided reproduction with example-docs/pdf/embedded-images.pdf and inspect the unstructured.partition.auto.partition entry point to trace how the PDF is handled. Compare the result with text-only and image-containing PDFs; done means the example produces the expected extracted elements instead of silently returning no output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100