Skip to content

fix: let override_file_extractors take precedence over pdf_mode - #881

Open
moneebullah25 wants to merge 2 commits into
Cinnamon:mainfrom
moneebullah25:fix/pdf-override-precedence
Open

moneebullah25 wants to merge 2 commits into
Cinnamon:mainfrom
moneebullah25:fix/pdf-override-precedence

Conversation

@moneebullah25

Copy link
Copy Markdown

Description

  • DocumentIngestor._get_reader applied override_file_extractors and then unconditionally reassigned .pdf from pdf_mode, so a .pdf override was ignored. The pdf_mode reader is now selected first and overrides are applied afterwards, so an explicit .pdf override wins.
  • Added an explicit "mathpix" branch. Any other unrecognised pdf_mode (e.g. "OCR", "mathpix ") now raises ValueError instead of silently falling through to MathpixPDFReader, a hosted service that needs credentials.
  • Updated the class docstring (lists multimodal, documents the ValueError and the override precedence) and added tests.
  • Fixes [BUG] DocumentIngestor ignores a ".pdf" entry in override_file_extractors; unknown pdf_mode falls through to Mathpix #878

Type of change

  • New features (non-breaking change).
  • Bug fix (non-breaking change).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).

Note: callers that passed an unrecognised pdf_mode previously got Mathpix silently and will now get a ValueError. No in-repo caller passes such a value.

Checklist

  • I have performed a self-review of my code.
  • I have added thorough tests if it is a core feature.
  • There is a reference to the original bug report and related work.
  • I have commented on my code, particularly in hard-to-understand areas.
  • The feature is well documented.

@moneebullah25 moneebullah25 changed the title fix(ingest): let override_file_extractors win for .pdf and reject unknown pdf_mode fix: let override_file_extractors take precedence over pdf_mode Oct 9, 2026

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.

[BUG] DocumentIngestor ignores a ".pdf" entry in override_file_extractors; unknown pdf_mode falls through to Mathpix

1 participant