Skip to content

feat: expose index segments in Python scanner#6872

Open
hfutatzhanghb wants to merge 3 commits into
lance-format:mainfrom
hfutatzhanghb:codex/expose-index-segments-python
Open

feat: expose index segments in Python scanner#6872
hfutatzhanghb wants to merge 3 commits into
lance-format:mainfrom
hfutatzhanghb:codex/expose-index-segments-python

Conversation

@hfutatzhanghb
Copy link
Copy Markdown
Contributor

Summary

Expose vector index segment selection through the Python scanner API. This adds an index_segments argument to LanceDataset.scanner(...) and ScannerBuilder, accepts str and uuid.UUID values in Python, parses them into Rust Uuids in the PyO3 binding, and forwards them to the existing Rust Scanner::with_index_segments support.

Why

Rust already supports restricting vector search to selected index segments. Python users creating distributed index segments need the same control from ds.scanner(...), similar to the existing fragments argument.

Validation

  • cargo check --manifest-path python/Cargo.toml -p pylance
  • git diff --check --cached

I did not complete the targeted pytest run because it triggered a local pylance rebuild and was stopped to avoid generating additional large target artifacts.

@github-actions github-actions Bot added enhancement New feature or request python labels May 20, 2026
@hfutatzhanghb hfutatzhanghb marked this pull request as ready for review May 20, 2026 13:18
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@hfutatzhanghb
Copy link
Copy Markdown
Contributor Author

@Xuanwo Hi, could you please help review this PR when have free time? Thanks a lot

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

Labels

enhancement New feature or request python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant