-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat: add location for all error #1475
Conversation
ACTION NEEDED Lance follows the Conventional Commits specification for release automation. The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
1edf686
to
92a89f7
Compare
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.
Thanks for putting this together. This should help speed up debugging. I have a few minor suggestions but I'm fine with this otherwise.
rust/lance/src/index/vector/ivf.rs
Outdated
@@ -573,14 +577,15 @@ fn sanity_check<'a>(dataset: &'a Dataset, column: &str) -> Result<&'a Field> { | |||
return Err( | |||
Error::Index{message: | |||
format!("VectorIndex requires the column data type to be fixed size list of float32s, got {}", | |||
elem_type.data_type())}); | |||
elem_type.data_type()), location: location!() }); |
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.
The formatting on this line seems slightly off but maybe it's just github
.map_err(|err| crate::Error::PrerequisiteFailed { message: err }) | ||
.map_err(|err| crate::Error::PrerequisiteFailed { | ||
message: err, | ||
location: location!(), |
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 reuse the inner error's location here?
.map_err(|err| crate::Error::PrerequisiteFailed { message: err }) | ||
.map_err(|err| crate::Error::PrerequisiteFailed { | ||
message: err, | ||
location: location!(), |
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 reuse the inner error's location here?
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.
It is hard to reuse location here because it is hard to add Clone
for Error
@@ -87,6 +104,7 @@ impl From<ArrowError> for Error { | |||
fn from(e: ArrowError) -> Self { | |||
Self::Arrow { | |||
message: e.to_string(), | |||
location: location!(), |
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 location is unlikely to be very useful but I'm not sure we can do much better since From
doesn't give us the option of forwarding the location.
c4afebe
to
a65b895
Compare
4687cd3
to
afff760
Compare
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.
Thanks for your help
Closed #1275