Skip to content

fix: skip invalid local sources in DoclingServeConverter#3449

Merged
julian-risch merged 1 commit into
mainfrom
fix/docling-serve-skip-invalid-local-sources
Jun 16, 2026
Merged

fix: skip invalid local sources in DoclingServeConverter#3449
julian-risch merged 1 commit into
mainfrom
fix/docling-serve-skip-invalid-local-sources

Conversation

@julian-risch

@julian-risch julian-risch commented Jun 16, 2026

Copy link
Copy Markdown
Member

Related Issues

Proposed Changes

Makes invalid local sources non-fatal in DoclingServeConverter.run() and run_async().

A missing or unreadable local file caused Path(source).read_bytes() to raise FileNotFoundError (an OSError), which propagated out of the conversion loop and aborted conversion of all remaining sources, discarding any already-converted documents. The loop already handled httpx errors and DoclingServe conversion/timeout errors, but not local-file read failures.

This adds an except (OSError, TypeError) handler to both run() and run_async() that logs a warning and skips the offending source, continuing with the rest. That is consistent with how the component already treats other per-source failures.

How did you test it?

I ran docling-serve with docker locally and tested the new functionality successfully

Notes for the Reviewer

Checklist

🤖 Generated with Claude Code

A missing or unreadable local file made Path(source).read_bytes() raise
FileNotFoundError (an OSError), which propagated out of run()/run_async()
and aborted conversion of all remaining sources. Catch OSError and TypeError
during source preparation, log a warning, and continue with the rest.

Ports the fix from #3150 onto the current merged integration.

Co-authored-by: turkesh <48882105+turkeshp@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@julian-risch
julian-risch requested a review from a team as a code owner June 16, 2026 07:22
@julian-risch
julian-risch requested review from sjrl and removed request for a team June 16, 2026 07:22
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report (docling_serve)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/docling_serve/src/haystack_integrations/components/converters/docling_serve
  converter.py 600
Project Total  

This report was generated by python-coverage-comment-action

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@julian-risch
julian-risch marked this pull request as draft June 16, 2026 07:24
@julian-risch
julian-risch marked this pull request as ready for review June 16, 2026 07:44
@julian-risch
julian-risch merged commit bc224c9 into main Jun 16, 2026
11 checks passed
@julian-risch
julian-risch deleted the fix/docling-serve-skip-invalid-local-sources branch June 16, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants