-
Notifications
You must be signed in to change notification settings - Fork 214
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
better error msg for query vector with wrong dim #1140
Conversation
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.
A minor readability suggestion but feel free to go on without it. Thanks for working on this!
rust/lancedb/src/table.rs
Outdated
if !matches!(field.data_type(), arrow_schema::DataType::FixedSizeList(f, dim) if f.data_type().is_floating() && dim == query_vector.len() as i32) | ||
{ | ||
return Err(Error::Schema { | ||
let schema_vec_dim = | ||
if let arrow_schema::DataType::FixedSizeList(_, dim) = field.data_type() { | ||
dim | ||
} else { | ||
unreachable!() | ||
}; |
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.
This is a little hard to follow. Maybe it would be easier now to just do..
if let arrow_schema::DataType::FixedSizeList(f, dim) = field.data_type()) {
if !f.data_type.is_floating() {
// Error, not a float
} else if dim != query_vector.len() {
// Error, not correct dimension
}
} else {
// Error, not a fixed-size-list type
}
…old files (lancedb#1140) * Added support for a cleanup_old_versions function which will remove expired files from a dataset --------- Co-authored-by: Will Jones <willjones127@gmail.com>
No description provided.