Join a description table into image similarity results#13
Merged
Conversation
Adds --desc-table to the image query CLI: a doc_id → description table (plain parquet/jsonl/csv file or a Lance table) is left-joined into the results of text-to-image and image-to-image similarity search (and the scalar mode, for consistency), adding a description column. Images without a description stay in the results with description = null. With --sql, the table is registered in the SQL scope as `descriptions` for hand-written joins. The scenario needs no extra ingestion step — Daft reads the parquet file directly as the join side.
Owner
Author
|
Rebased onto main after #12 merged; base retargeted to main. Full suite green locally (78 passed). |
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
Stacked on #12. Builds the multi-table scenario: a description table (
doc_id → description) is joined into image similarity search results.--desc-table <uri>on the image query CLI: accepts a plain parquet/jsonl/csv file or a Lance table — Daft reads it directly as the join side, no ingestion step needed.--text), image-to-image (--image-path/--image-from) and scalar results gain adescriptioncolumn via left join ondoc_id— images without a description stay in the results withdescription = null.--sql, the table is registered in the SQL scope asdescriptionsfor hand-written joins (... FROM images i LEFT JOIN descriptions d ON i.doc_id = d.doc_id).descriptions.parquetin a few lines of code, then query with--desc-table).Testing
tests/image/test_desc_join.py: text/doc similarity with joined descriptions, missing-description → null, extra doc_ids in the description table ignored, manual SQL join, and a regression that omitting--desc-tablekeeps existing output shape.uv run pytest tests/ -q→ 77 passed.Note: base is
image-similarity-search; retarget tomainand rebase after #12 merges.