Skip to content
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

Merged
merged 15 commits into from
Nov 2, 2023
Merged

Conversation

Weijun-H
Copy link
Contributor

Closed #1275

@github-actions
Copy link

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.

@Weijun-H Weijun-H changed the title Minor: add location for all error feat: add location for all error Oct 27, 2023
@Weijun-H Weijun-H force-pushed the location-all-error branch 2 times, most recently from 1edf686 to 92a89f7 Compare October 28, 2023 09:26
@eddyxu eddyxu requested review from westonpace and wjones127 and removed request for westonpace October 30, 2023 06:59
Copy link
Contributor

@westonpace westonpace left a 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.

@@ -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!() });
Copy link
Contributor

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!(),
Copy link
Contributor

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!(),
Copy link
Contributor

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?

Copy link
Contributor Author

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

rust/lance/src/index/vector/ivf/builder.rs Show resolved Hide resolved
@@ -87,6 +104,7 @@ impl From<ArrowError> for Error {
fn from(e: ArrowError) -> Self {
Self::Arrow {
message: e.to_string(),
location: location!(),
Copy link
Contributor

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.

rust/lance-core/src/error.rs Outdated Show resolved Hide resolved
rust/lance-core/src/error.rs Outdated Show resolved Hide resolved
@Weijun-H Weijun-H force-pushed the location-all-error branch 2 times, most recently from c4afebe to a65b895 Compare November 1, 2023 23:02
Copy link
Contributor

@westonpace westonpace left a 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

@westonpace westonpace merged commit 6224356 into lancedb:main Nov 2, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Location to all error types
2 participants