test(python): cover vector index prewarming by name (#3859)

## Summary

- cover vector-index prewarming through the Python API using the logical
index name returned by list_indices
- prevent regression to interpreting a vector index name as a schema
column

## Root cause

The Lance version used by the reported release opened a vector index by
treating the prewarm argument as a column before resolving the index
metadata. Current LanceDB dependencies contain the upstream
metadata-based resolution, but LanceDB only exercised prewarming for FTS
indexes, leaving the vector behavior unguarded.

## Validation

- uv run --extra tests pytest
python/tests/test_index.py::test_create_vector_index -q
- python/.venv/bin/ruff format --check python/python/tests/test_index.py
- python/.venv/bin/ruff check .

Fixes #2897

<!-- lance-gatekeeper-fix:v1 agent=c2f8273221061d8e2b6f7393066e68c6
generation=1 -->

Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
lancedb-gatefixer[bot]
2026-10-29 10:45:34 +08:00
committed by GitHub
co-authored by Xuanwo
parent 65954bf9cc
commit 913ee160b0
+2
View File
@@ -364,6 +364,8 @@ async def test_create_vector_index(some_table: AsyncTable):
assert indices[0].columns == ["vector"]
assert indices[0].name == "vector_idx"
await some_table.prewarm_index(indices[0].name)
stats = await some_table.index_stats("vector_idx")
assert stats.index_type == "IVF_PQ"
assert stats.distance_type == "l2"