Skip to content

docs(index): fix the stale default for num_indices_to_merge - #9240

Open
jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:fix/optimize-options-default-doc
Open

jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:fix/optimize-options-default-doc

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

The doc comment on OptimizeOptions::num_indices_to_merge says the default is 1, but impl Default for OptimizeOptions sets it to None, and the paragraph right below already describes the None behavior. The field became an Option<usize> in #4837, whose description notes that "the default is None (1 before this)" -- the first line of the comment was left behind.

A caller reading the published docs concludes that OptimizeOptions::default() merges one delta index per optimize call and therefore keeps the delta count bounded, when the actual default creates a new delta index unless a partition is split. The Python binding already documents this correctly.

Match the wording to retrain, which states its default the same way in the same struct.

Testing

cargo fmt --all -- --check and cargo clippy --release -p lance-index --all-features --all-targets -- -D warnings.

The doc comment on `OptimizeOptions::num_indices_to_merge` says the default
is `1`, but `impl Default for OptimizeOptions` sets it to `None`, and the
paragraph right below already describes the `None` behavior. The field became
an `Option<usize>` in lance-format#4837, whose description notes that "the default is
`None` (`1` before this)" -- the first line of the comment was left behind.

A caller reading the published docs concludes that `OptimizeOptions::default()`
merges one delta index per optimize call and therefore keeps the delta count
bounded, when the actual default creates a new delta index unless a partition
is split. The Python binding already documents this correctly.

Match the wording to `retrain`, which states its default the same way in the
same struct.

## Testing

`cargo fmt --all -- --check` and
`cargo clippy --release -p lance-index --all-features --all-targets -- -D warnings`.
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer documentation Improvements or additions to documentation labels Sep 15, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

This corrects the stale Rust API documentation to match OptimizeOptions::default() and the None semantics already documented for incremental index optimization. The change is appropriately limited to the misleading default statement.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer documentation Improvements or additions to documentation K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant