lance-format / lance-format/lance

bug: CapturedRowIds::row_addrs panics instead of returning an error

Open Beginner friendly
#9,306 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

Description

CapturedRowIds::row_addrs (rust/lance/src/dataset/utils.rs) returns a Result, but its sequence-style branch panics in two states: panic!("RowIdIndex required for sequence style row ids") when no row id index is passed in, and .expect("row id missing from index") when a captured row id is not in the index. The function is called from the update, delete and compaction paths.

Neither state is reachable today. CapturedRowIds::SequenceStyle is only built when the dataset uses stable row ids, and that is the same condition under which get_row_id_index returns Some; all three call sites read both from the same Dataset instance. dataset::utils is also a private module, so nothing outside the crate can call it.

The problem is the signature, not a behavior a user can hit: a function that declares Result and then panics hands the next caller a panic where the signature promises an Err, and rust/AGENTS.md says library code should not use panic! or expect for fallible operations.

Steps to reproduce
// Inside the `lance` crate, since `dataset::utils` is private:
let captured = CapturedRowIds::SequenceStyle(RowIdSequence::from(0..2u64));

// panics: RowIdIndex required for sequence style row ids
let _ = captured.row_addrs(None);

// panics: row id missing from index
let index = RowIdIndex::new(&[]).unwrap();
let _ = captured.row_addrs(Some(&index));
Expected behavior

Both states return Err, with a message that names what is missing: the index, or the row id that could not be resolved.

Lance version

13.0.0-beta.3 (main)

Language binding

Rust

Environment

macOS ARM, local storage. Not platform-specific.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rust/lance/src/dataset/utils.rs and read rust/AGENTS.md for the library's fallible-operation guidance. Inspect CapturedRowIds::row_addrs and its sequence-style branch, then verify the two described states return errors naming the missing index or unresolved row id instead of panicking; check the update, delete, and compaction call paths afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.