-
Notifications
You must be signed in to change notification settings - Fork 207
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(java): add version latestVersion api #2238
Conversation
@@ -127,14 +129,18 @@ public void createDatasetAndValidate() throws IOException, URISyntaxException { | |||
assertEquals(ROW_COUNT, dataset.countRows()); | |||
schema = reader.getVectorSchemaRoot().getSchema(); | |||
validateFragments(dataset); | |||
assertEquals(1, dataset.version()); | |||
assertEquals(1, dataset.latestVersion()); |
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.
Do we have tests where version() != latestVersion()
?
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.
Addressed the comment, PTAL
@eddyxu PTAL, thanks! |
@eddyxu PTAL |
#[snafu(display("Invalid argument: {}", message))] | ||
InvalidArgument { message: String }, | ||
#[snafu(display("Invalid argument: {}, location: {}", message, location))] | ||
InvalidArgument { message: 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.
why do we need Location in the error msg?
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 tells us which line generated the error. This is how we get a "stack trace" when an error happens
java/core/lance-jni/src/error.rs
Outdated
@@ -97,6 +97,7 @@ impl From<Utf8Error> for Error { | |||
fn from(source: Utf8Error) -> Self { | |||
Self::InvalidArgument { | |||
message: source.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 should use track_caller
location instead of the conversion site 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.
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 the example @chebbyChefNEQ ! Addressed the comments, PTAL
No description provided.