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(java): add version latestVersion api #2238

Merged
merged 8 commits into from
Apr 26, 2024
Merged

Conversation

LuQQiu
Copy link
Collaborator

@LuQQiu LuQQiu commented Apr 22, 2024

No description provided.

@LuQQiu LuQQiu requested a review from eddyxu April 22, 2024 03:42
@@ -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());
Copy link
Contributor

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()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the comment, PTAL

@LuQQiu
Copy link
Collaborator Author

LuQQiu commented Apr 24, 2024

@eddyxu PTAL, thanks!

@LuQQiu
Copy link
Collaborator Author

LuQQiu commented Apr 25, 2024

@eddyxu PTAL

@eddyxu eddyxu requested a review from QianZhu April 25, 2024 22:57
#[snafu(display("Invalid argument: {}", message))]
InvalidArgument { message: String },
#[snafu(display("Invalid argument: {}, location: {}", message, location))]
InvalidArgument { message: 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.

why do we need Location in the error msg?

Copy link
Contributor

@chebbyChefNEQ chebbyChefNEQ Apr 26, 2024

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

@@ -97,6 +97,7 @@ impl From<Utf8Error> for Error {
fn from(source: Utf8Error) -> Self {
Self::InvalidArgument {
message: source.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 should use track_caller location instead of the conversion site location.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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

@LuQQiu LuQQiu merged commit fc9757b into lancedb:main Apr 26, 2024
2 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.

4 participants