diff --git a/docs/requirements.txt b/docs/requirements.txt index 60d3b5e3e..e5f3867cb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,8 +1,8 @@ -mkdocs==1.5.3 +mkdocs==1.6.1 mkdocs-jupyter==0.24.1 -mkdocs-material==9.5.3 +mkdocs-material==9.6.23 mkdocs-autorefs>=0.5,<=1.0 -mkdocstrings[python]==0.25.2 +mkdocstrings[python]>=0.24,<1.0 griffe>=0.40,<1.0 mkdocs-render-swagger-plugin>=0.1.0 pydantic>=2.0,<3.0 diff --git a/python/python/lancedb/table.py b/python/python/lancedb/table.py index 0f0acaea0..e4bf24577 100644 --- a/python/python/lancedb/table.py +++ b/python/python/lancedb/table.py @@ -4751,7 +4751,16 @@ class IndexStatistics: num_indexed_rows: int num_unindexed_rows: int index_type: Literal[ - "IVF_PQ", "IVF_HNSW_PQ", "IVF_HNSW_SQ", "FTS", "BTREE", "BITMAP", "LABEL_LIST" + "IVF_FLAT", + "IVF_SQ", + "IVF_PQ", + "IVF_RQ", + "IVF_HNSW_SQ", + "IVF_HNSW_PQ", + "FTS", + "BTREE", + "BITMAP", + "LABEL_LIST", ] distance_type: Optional[Literal["l2", "cosine", "dot"]] = None num_indices: Optional[int] = None diff --git a/python/python/tests/test_index.py b/python/python/tests/test_index.py index b4097a8f0..8dfa55a77 100644 --- a/python/python/tests/test_index.py +++ b/python/python/tests/test_index.py @@ -3,6 +3,7 @@ from datetime import timedelta import random +from typing import get_args, get_type_hints import pyarrow as pa import pytest @@ -22,6 +23,7 @@ from lancedb.index import ( HnswSq, FTS, ) +from lancedb.table import IndexStatistics @pytest_asyncio.fixture @@ -283,3 +285,23 @@ async def test_create_index_with_binary_vectors(binary_table: AsyncTable): for v in range(256): res = await binary_table.query().nearest_to([v] * 128).to_arrow() assert res["id"][0].as_py() == v + + +def test_index_statistics_index_type_lists_all_supported_values(): + expected_index_types = { + "IVF_FLAT", + "IVF_SQ", + "IVF_PQ", + "IVF_RQ", + "IVF_HNSW_SQ", + "IVF_HNSW_PQ", + "FTS", + "BTREE", + "BITMAP", + "LABEL_LIST", + } + + assert ( + set(get_args(get_type_hints(IndexStatistics)["index_type"])) + == expected_index_types + )