feat(python): expose index cache size (#655)

This is to enable https://github.com/lancedb/lancedb/issues/641.
Should be merged after https://github.com/lancedb/lance/pull/1587 is
released.
This commit is contained in:
Rok Mihevc
2023-11-18 23:17:40 +01:00
committed by GitHub
parent ccfdf4853a
commit d8e3e54226
4 changed files with 15 additions and 0 deletions

View File

@@ -188,6 +188,7 @@ class Table(ABC):
vector_column_name: str = VECTOR_COLUMN_NAME,
replace: bool = True,
accelerator: Optional[str] = None,
index_cache_size: Optional[int] = None,
):
"""Create an index on the table.
@@ -212,6 +213,8 @@ class Table(ABC):
accelerator: str, default None
If set, use the given accelerator to create the index.
Only support "cuda" for now.
index_cache_size : int, optional
The size of the index cache in number of entries. Default value is 256.
"""
raise NotImplementedError
@@ -556,6 +559,7 @@ class LanceTable(Table):
vector_column_name=VECTOR_COLUMN_NAME,
replace: bool = True,
accelerator: Optional[str] = None,
index_cache_size: Optional[int] = None,
):
"""Create an index on the table."""
self._dataset.create_index(
@@ -566,6 +570,7 @@ class LanceTable(Table):
num_sub_vectors=num_sub_vectors,
replace=replace,
accelerator=accelerator,
index_cache_size=index_cache_size,
)
self._reset_dataset()
register_event("create_index")