chore: bump lance to 8.10 (#622)

This commit is contained in:
Lei Xu
2023-11-01 14:14:38 -07:00
committed by Weston Pace
parent 07ab4cd14c
commit 3855bdf986
5 changed files with 16 additions and 14 deletions

View File

@@ -5,9 +5,9 @@ exclude = ["python"]
resolver = "2" resolver = "2"
[workspace.dependencies] [workspace.dependencies]
lance = { "version" = "=0.8.9", "features" = ["dynamodb"] } lance = { "version" = "=0.8.10", "features" = ["dynamodb"] }
lance-linalg = { "version" = "=0.8.9" } lance-linalg = { "version" = "=0.8.10" }
lance-testing = { "version" = "=0.8.9" } lance-testing = { "version" = "=0.8.10" }
# Note that this one does not include pyarrow # Note that this one does not include pyarrow
arrow = { version = "47.0.0", optional = false } arrow = { version = "47.0.0", optional = false }
arrow-array = "47.0" arrow-array = "47.0"

View File

@@ -3,7 +3,7 @@ name = "lancedb"
version = "0.3.2" version = "0.3.2"
dependencies = [ dependencies = [
"deprecation", "deprecation",
"pylance==0.8.9", "pylance==0.8.10",
"ratelimiter~=1.0", "ratelimiter~=1.0",
"retry>=0.9.2", "retry>=0.9.2",
"tqdm>=4.1.0", "tqdm>=4.1.0",

View File

@@ -70,7 +70,6 @@ fn get_index_params_builder(
.map(|mt| { .map(|mt| {
let metric_type = mt.unwrap(); let metric_type = mt.unwrap();
index_builder.metric_type(metric_type); index_builder.metric_type(metric_type);
pq_params.metric_type = metric_type;
}); });
let num_partitions = obj.get_opt_usize(cx, "num_partitions")?; let num_partitions = obj.get_opt_usize(cx, "num_partitions")?;

View File

@@ -99,7 +99,11 @@ impl VectorIndexBuilder for IvfPQIndexBuilder {
let ivf_params = self.ivf_params.clone().unwrap_or_default(); let ivf_params = self.ivf_params.clone().unwrap_or_default();
let pq_params = self.pq_params.clone().unwrap_or_default(); let pq_params = self.pq_params.clone().unwrap_or_default();
VectorIndexParams::with_ivf_pq_params(pq_params.metric_type, ivf_params, pq_params) VectorIndexParams::with_ivf_pq_params(
self.metric_type.unwrap_or(MetricType::L2),
ivf_params,
pq_params,
)
} }
fn get_replace(&self) -> bool { fn get_replace(&self) -> bool {
@@ -180,7 +184,6 @@ mod tests {
pq_params.max_iters = 1; pq_params.max_iters = 1;
pq_params.num_bits = 8; pq_params.num_bits = 8;
pq_params.num_sub_vectors = 50; pq_params.num_sub_vectors = 50;
pq_params.metric_type = MetricType::Cosine;
pq_params.max_opq_iters = 2; pq_params.max_opq_iters = 2;
index_builder.ivf_params(ivf_params); index_builder.ivf_params(ivf_params);
index_builder.pq_params(pq_params); index_builder.pq_params(pq_params);
@@ -198,7 +201,6 @@ mod tests {
assert_eq!(pq_params.max_iters, 1); assert_eq!(pq_params.max_iters, 1);
assert_eq!(pq_params.num_bits, 8); assert_eq!(pq_params.num_bits, 8);
assert_eq!(pq_params.num_sub_vectors, 50); assert_eq!(pq_params.num_sub_vectors, 50);
assert_eq!(pq_params.metric_type, MetricType::Cosine);
assert_eq!(pq_params.max_opq_iters, 2); assert_eq!(pq_params.max_opq_iters, 2);
} else { } else {
assert!(false, "Expected second stage to be pq") assert!(false, "Expected second stage to be pq")

View File

@@ -27,7 +27,7 @@ use lance::io::object_store::WrappingObjectStore;
use std::path::Path; use std::path::Path;
use crate::error::{Error, Result}; use crate::error::{Error, Result};
use crate::index::vector::{VectorIndexBuilder, VectorIndex}; use crate::index::vector::{VectorIndex, VectorIndexBuilder};
use crate::query::Query; use crate::query::Query;
use crate::utils::{PatchReadParam, PatchWriteParam}; use crate::utils::{PatchReadParam, PatchWriteParam};
use crate::WriteMode; use crate::WriteMode;
@@ -393,11 +393,12 @@ impl Table {
} }
pub async fn load_indices(&self) -> Result<Vec<VectorIndex>> { pub async fn load_indices(&self) -> Result<Vec<VectorIndex>> {
let (indices, mf) = futures::try_join!( let (indices, mf) =
self.dataset.load_indices(), futures::try_join!(self.dataset.load_indices(), self.dataset.latest_manifest())?;
self.dataset.latest_manifest() Ok(indices
)?; .iter()
Ok(indices.iter().map(|i| VectorIndex::new_from_format(&mf, i)).collect()) .map(|i| VectorIndex::new_from_format(&mf, i))
.collect())
} }
} }