Skip to content

fix: dont sample if no vectors are needed#6110

Merged
westonpace merged 2 commits intolance-format:mainfrom
westonpace:fix/shortcut-sample-on-rq
Mar 6, 2026
Merged

fix: dont sample if no vectors are needed#6110
westonpace merged 2 commits intolance-format:mainfrom
westonpace:fix/shortcut-sample-on-rq

Conversation

@westonpace
Copy link
Copy Markdown
Member

Some quantizers (just RQ at the moment) don't actually need to sample any training data. In some paths (e.g. the fallback sampling with lots of nulls) this could lead to errors because it would actually still do some sampling. This adds a shortcut to immediately return an empty array if no sampling is required.

@github-actions github-actions Bot added bug Something isn't working python labels Mar 5, 2026
Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thank you for this!

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/index/vector/utils.rs 81.81% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@westonpace westonpace merged commit 574f002 into lance-format:main Mar 6, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants