From 30ef1f05acd9a18ac802c16292e98611dbbac5cc Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Thu, 6 Nov 2025 01:25:35 +0800 Subject: [PATCH 1/3] chore: fix the method spell Signed-off-by: BubbleCal --- rust/lance/src/dataset.rs | 2 +- rust/lance/src/dataset/scanner.rs | 2 +- rust/lance/src/index/vector/ivf/v2.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/lance/src/dataset.rs b/rust/lance/src/dataset.rs index fa5503e531d..568d47c768d 100644 --- a/rust/lance/src/dataset.rs +++ b/rust/lance/src/dataset.rs @@ -5307,7 +5307,7 @@ mod tests { let batches = scan .nearest("vector", &query_vec, 2000) .unwrap() - .nprobs(4) + .nprobes(4) .prefilter(true) .try_into_stream() .await diff --git a/rust/lance/src/dataset/scanner.rs b/rust/lance/src/dataset/scanner.rs index 57980466cb6..02e0b4bea49 100644 --- a/rust/lance/src/dataset/scanner.rs +++ b/rust/lance/src/dataset/scanner.rs @@ -1080,7 +1080,7 @@ impl Scanner { /// /// This method is a convenience method that sets both [Self::minimum_nprobes] and /// [Self::maximum_nprobes] to the same value. - pub fn nprobs(&mut self, n: usize) -> &mut Self { + pub fn nprobes(&mut self, n: usize) -> &mut Self { if let Some(q) = self.nearest.as_mut() { q.minimum_nprobes = n; q.maximum_nprobes = Some(n); diff --git a/rust/lance/src/index/vector/ivf/v2.rs b/rust/lance/src/index/vector/ivf/v2.rs index 06fb990d380..f6ea14b107e 100644 --- a/rust/lance/src/index/vector/ivf/v2.rs +++ b/rust/lance/src/index/vector/ivf/v2.rs @@ -1913,7 +1913,7 @@ mod tests { .scan() .nearest(vector_column, query.as_primitive::(), k) .unwrap() - .nprobs(nlist) + .nprobes(nlist) .with_row_id() .try_into_batch() .await From 03083579e1524222ab30cbc3e8df2d501973a33e Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Thu, 6 Nov 2025 01:28:46 +0800 Subject: [PATCH 2/3] fix more Signed-off-by: BubbleCal --- python/src/dataset.rs | 4 ++-- rust/lance/src/dataset.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/dataset.rs b/python/src/dataset.rs index 65486cecf61..8c8e1842eae 100644 --- a/python/src/dataset.rs +++ b/python/src/dataset.rs @@ -103,7 +103,7 @@ pub mod commit; pub mod optimize; pub mod stats; -const DEFAULT_NPROBS: usize = 20; +const DEFAULT_NPROBES: usize = 20; const LANCE_COMMIT_MESSAGE_KEY: &str = "__lance_commit_message"; fn convert_reader(reader: &Bound) -> PyResult> { @@ -981,7 +981,7 @@ impl Dataset { 10 }; - let mut minimum_nprobes = DEFAULT_NPROBS; + let mut minimum_nprobes = DEFAULT_NPROBES; let mut maximum_nprobes = None; if let Some(nprobes) = nearest.get_item("nprobes")? { diff --git a/rust/lance/src/dataset.rs b/rust/lance/src/dataset.rs index 568d47c768d..b9e56b0d9c4 100644 --- a/rust/lance/src/dataset.rs +++ b/rust/lance/src/dataset.rs @@ -5246,7 +5246,7 @@ mod tests { // let scan_fut = scan // .nearest("vector", &query_vec, 2000) // .unwrap() - // .nprobs(4) + // .nprobes(4) // .prefilter(true) // .try_into_stream() // .await From b375eeee71066286fa13067516521eccd496f513 Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Thu, 6 Nov 2025 01:33:58 +0800 Subject: [PATCH 3/3] not breaking Signed-off-by: BubbleCal --- .typos.toml | 4 ++++ rust/lance/src/dataset/scanner.rs | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.typos.toml b/.typos.toml index 9afb7ed71c6..fc490c95dcf 100644 --- a/.typos.toml +++ b/.typos.toml @@ -12,6 +12,10 @@ typ = "typ" rabit = "rabit" flate = "flate" +[default.expect] +nprobs = "nprobes" +nprob = "nprobe" + [files] extend-exclude = ["notebooks/*.ipynb"] # If a line ends with # or // and has spellchecker:disable-line, ignore it diff --git a/rust/lance/src/dataset/scanner.rs b/rust/lance/src/dataset/scanner.rs index 02e0b4bea49..7aa8e379a0e 100644 --- a/rust/lance/src/dataset/scanner.rs +++ b/rust/lance/src/dataset/scanner.rs @@ -1090,6 +1090,21 @@ impl Scanner { self } + /// Configures how many partititions will be searched in the vector index. + /// + /// This method is a convenience method that sets both [Self::minimum_nprobes] and + /// [Self::maximum_nprobes] to the same value. + #[deprecated(note = "Use nprobes instead")] + pub fn nprobs(&mut self, n: usize) -> &mut Self { + if let Some(q) = self.nearest.as_mut() { + q.minimum_nprobes = n; + q.maximum_nprobes = Some(n); + } else { + log::warn!("nprobes is not set because nearest has not been called yet"); + } + self + } + /// Configures the minimum number of partitions to search in the vector index. /// /// If we have found k matching results after searching this many partitions then