test: lock format_router extensions to parse adapters - #419
Open
Frankie-Xu wants to merge 1 commit into
Open
Frankie-Xu wants to merge 1 commit into
Frankie-Xu wants to merge 1 commit into
Conversation
Keep SUPPORTED_FILE_TYPES, resolve_document_format, and get_document_parse_adapter as inverses so a new extension cannot ship without an adapter (or the reverse). Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Frankie-Xu
marked this pull request as ready for review
September 14, 2026 18:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
format_router.py: everySUPPORTED_FILE_TYPESextension is resolvable, and everyDocumentFormathas an adapter (and the reverse).KeyErrorfrom adding an extension withoutadapter_by_format, or an adapter that no supported extension can reach.Verification
make lint— All checks passedmake typecheck— 0 errors, 0 warnings, 0 informationscd apps/worker && uv run pytest -p no:postgresql tests/unit/test_format_router_adapter_map.py -q— 16 passed-p no:postgresqlis only to skip the autoloadedpytest-postgresqlplugin in this environment (no libpq). The tests do not use Postgres.Deployment Notes
Checklist