mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-07 04:12:59 +00:00
Compare commits
3 Commits
v0.14.1
...
python-v0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dae8334d0b | ||
|
|
8c81968b59 | ||
|
|
16cf2990f3 |
@@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.17.1"
|
current_version = "0.17.2-beta.0"
|
||||||
parse = """(?x)
|
parse = """(?x)
|
||||||
(?P<major>0|[1-9]\\d*)\\.
|
(?P<major>0|[1-9]\\d*)\\.
|
||||||
(?P<minor>0|[1-9]\\d*)\\.
|
(?P<minor>0|[1-9]\\d*)\\.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lancedb-python"
|
name = "lancedb-python"
|
||||||
version = "0.17.1"
|
version = "0.17.2-beta.0"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
description = "Python bindings for LanceDB"
|
description = "Python bindings for LanceDB"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import warnings
|
|||||||
|
|
||||||
from lancedb._lancedb import IndexConfig
|
from lancedb._lancedb import IndexConfig
|
||||||
from lancedb.embeddings.base import EmbeddingFunctionConfig
|
from lancedb.embeddings.base import EmbeddingFunctionConfig
|
||||||
from lancedb.index import FTS, BTree, Bitmap, HnswPq, HnswSq, IvfPq, LabelList
|
from lancedb.index import FTS, BTree, Bitmap, HnswPq, HnswSq, IvfFlat, IvfPq, LabelList
|
||||||
from lancedb.remote.db import LOOP
|
from lancedb.remote.db import LOOP
|
||||||
import pyarrow as pa
|
import pyarrow as pa
|
||||||
|
|
||||||
@@ -235,10 +235,12 @@ class RemoteTable(Table):
|
|||||||
config = HnswPq(distance_type=metric)
|
config = HnswPq(distance_type=metric)
|
||||||
elif index_type == "IVF_HNSW_SQ":
|
elif index_type == "IVF_HNSW_SQ":
|
||||||
config = HnswSq(distance_type=metric)
|
config = HnswSq(distance_type=metric)
|
||||||
|
elif index_type == "IVF_FLAT":
|
||||||
|
config = IvfFlat(distance_type=metric)
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Unknown vector index type: {index_type}. Valid options are"
|
f"Unknown vector index type: {index_type}. Valid options are"
|
||||||
" 'IVF_PQ', 'IVF_HNSW_PQ', 'IVF_HNSW_SQ'"
|
" 'IVF_FLAT', 'IVF_PQ', 'IVF_HNSW_PQ', 'IVF_HNSW_SQ'"
|
||||||
)
|
)
|
||||||
|
|
||||||
LOOP.run(self._table.create_index(vector_column_name, config=config))
|
LOOP.run(self._table.create_index(vector_column_name, config=config))
|
||||||
|
|||||||
@@ -563,6 +563,7 @@ impl<S: HttpSend> TableInternal for RemoteTable<S> {
|
|||||||
let (index_type, distance_type) = match index.index {
|
let (index_type, distance_type) = match index.index {
|
||||||
// TODO: Should we pass the actual index parameters? SaaS does not
|
// TODO: Should we pass the actual index parameters? SaaS does not
|
||||||
// yet support them.
|
// yet support them.
|
||||||
|
Index::IvfFlat(index) => ("IVF_FLAT", Some(index.distance_type)),
|
||||||
Index::IvfPq(index) => ("IVF_PQ", Some(index.distance_type)),
|
Index::IvfPq(index) => ("IVF_PQ", Some(index.distance_type)),
|
||||||
Index::IvfHnswSq(index) => ("IVF_HNSW_SQ", Some(index.distance_type)),
|
Index::IvfHnswSq(index) => ("IVF_HNSW_SQ", Some(index.distance_type)),
|
||||||
Index::BTree(_) => ("BTREE", None),
|
Index::BTree(_) => ("BTREE", None),
|
||||||
@@ -873,6 +874,7 @@ mod tests {
|
|||||||
use lance_index::scalar::FullTextSearchQuery;
|
use lance_index::scalar::FullTextSearchQuery;
|
||||||
use reqwest::Body;
|
use reqwest::Body;
|
||||||
|
|
||||||
|
use crate::index::vector::IvfFlatIndexBuilder;
|
||||||
use crate::{
|
use crate::{
|
||||||
index::{vector::IvfPqIndexBuilder, Index, IndexStatistics, IndexType},
|
index::{vector::IvfPqIndexBuilder, Index, IndexStatistics, IndexType},
|
||||||
query::{ExecutableQuery, QueryBase},
|
query::{ExecutableQuery, QueryBase},
|
||||||
@@ -1489,6 +1491,11 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_create_index() {
|
async fn test_create_index() {
|
||||||
let cases = [
|
let cases = [
|
||||||
|
(
|
||||||
|
"IVF_FLAT",
|
||||||
|
Some("hamming"),
|
||||||
|
Index::IvfFlat(IvfFlatIndexBuilder::default().distance_type(DistanceType::Hamming)),
|
||||||
|
),
|
||||||
("IVF_PQ", Some("l2"), Index::IvfPq(Default::default())),
|
("IVF_PQ", Some("l2"), Index::IvfPq(Default::default())),
|
||||||
(
|
(
|
||||||
"IVF_PQ",
|
"IVF_PQ",
|
||||||
|
|||||||
Reference in New Issue
Block a user