test(index): cover KeepFiniteVectors row filtering - #8229
Conversation
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The transformer-level tests directly pin null and non-finite row filtering, empty and all-null inputs, missing-column pass-through, and contextual type errors. This is the right boundary for protecting the shared filtering behavior used by the IVF construction paths.
|
The red checks here are not from this change — Same run on
This PR only appends to |
`KeepFiniteVectors` runs on every IVF build path (five construction sites in `vector/ivf.rs`) and has three behaviours: drop rows whose vector is null, drop rows containing NaN or an infinity, and error on a column that is not a fixed size list. None of them was tested — the existing tests in this module exercise `is_all_finite` and the `l2` overflow bounds, never the transformer itself. Adds coverage for all three, plus the all-null and empty-batch cases that `AGENTS.md` asks for in index tests, and the missing-column pass-through. The non-list case also pins the error message, which already names the column and the offending type. Verified the row-filtering test fails if the validity check is bypassed. Co-Authored-By: Claude <noreply@anthropic.com>
a59b529 to
de71287
Compare
|
Rebased onto d95cb36 to pick up #8261, which fixed the Correcting my earlier comment: the first bad commit was a2d3047 (#8227), not #8024 — a duplicate
|
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The rebase preserves the previously reviewed transformer-level coverage unchanged, and the focused tests pass on the new base. The direct unit boundary continues to protect the shared filtering behavior across the IVF construction paths.
KeepFiniteVectorsruns on every IVF build path — five construction sites invector/ivf.rs— and has three behaviours: drop rows whose vector is null, drop rows containing NaN or an infinity, and error on a column that is not a fixed size list. None of them was tested. The existing tests in this module exercise theis_all_finitefree function and thel2overflow bounds, never the transformer itself;grep KeepFiniteVectors::newreturns only the five production sites.Adds coverage for all three behaviours, plus the all-null and empty-batch cases
AGENTS.mdasks for in index tests, and the missing-column pass-through. The non-list case also pins the error message, which already names the column and the offending type.Testing
cargo test -p lance-index --lib vector::transform— 12 passtest_keep_finite_vectors_drops_null_and_non_finite_rowsfails when the validity check intransformis bypassed, so it is a real regression testcargo fmt --all -- --check,cargo clippy -p lance-index --tests -- -D warnings