-
Notifications
You must be signed in to change notification settings - Fork 513
fix: avoid panic while hitting non-null empty multi-vector #5588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Code ReviewP0: Bug in
|
BubbleCal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does it panic before this change?
rust/lance-linalg/src/distance.rs
Outdated
| let multivector = v.as_fixed_size_list(); | ||
| match distance_type { | ||
| if multivector.len() == 0 { | ||
| return Err(ArrowError::InvalidArgumentError(format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just assume the distance to a empty multivector is NaN and then exclude it from the results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if 0a61738 is what you want
Our tokio runtime worker panic at lance/rust/lance-index/src/vector/flat.rs Line 147 in 543eb86
Resulted by lance/rust/lance-linalg/src/distance.rs Lines 142 to 149 in 543eb86
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This PR will avoid panic while hitting non-null empty multi-vector
Parts of this PR were drafted with assistance from Codex (with
gpt-5.2) and fully reviewed and edited by me. I take full responsibility for all changes.