Skip to content

fix: no panic on unknown version#5111

Merged
wjones127 merged 4 commits intolance-format:mainfrom
wjones127:fix/no-version-panic
Oct 31, 2025
Merged

fix: no panic on unknown version#5111
wjones127 merged 4 commits intolance-format:mainfrom
wjones127:fix/no-version-panic

Conversation

@wjones127
Copy link
Copy Markdown
Contributor

For more context, see: #5099 (reply in thread)

@github-actions github-actions Bot added the bug Something isn't working label Oct 30, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 70.49180% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.71%. Comparing base (ce1edf9) to head (763435d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance-table/src/format/manifest.rs 66.66% 13 Missing and 3 partials ⚠️
rust/lance/src/io/commit.rs 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5111      +/-   ##
==========================================
+ Coverage   81.69%   81.71%   +0.01%     
==========================================
  Files         340      340              
  Lines      138875   138910      +35     
  Branches   138875   138910      +35     
==========================================
+ Hits       113456   113509      +53     
+ Misses      21679    21665      -14     
+ Partials     3740     3736       -4     
Flag Coverage Δ
unittests 81.71% <70.49%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread rust/lance-table/src/format/manifest.rs Outdated

/// A parsed Lance library version with major, minor, and patch components.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct LanceVersion {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we want a new LanceVersion instead of just the current WriterVersion? If we are doing this, I think we should just use https://docs.rs/semver/latest/semver/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

WriterVersion is the version of some arbitrary library. It might be lance, it might be another library. And if it's another library, it might not use a semantic versioning scheme.

LanceVersion is the version of the Lance Rust library. We guarantee it's semantically versioned. We could pull in semver for this, but it's also not clear we really care to add a dependency for this stuff. If you think it's worth it, feel free.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the main benefit is that it handles all sorts of pre release string formats so we don't need a custom parser anymore. Originally Xuanwo proposed it but I didn't add because it breaks backwards compatibility, but since we are already refactoring it here we could just do it along the way. But I can put another PR for it after this along they way to make the pre release forward compatible. I will just hold off publishing it until this is merged.

Comment thread rust/lance-table/src/format/manifest.rs Outdated
Comment thread rust/lance-table/src/format/manifest.rs Outdated
Previously, version parsing was done manually with string splitting.
This changes LanceVersion to wrap semver::Version, providing robust
parsing and proper handling of pre-release versions like beta.1.

Also renames lance_version() to lance_lib_version() to clarify that
it refers to the library version, not the file format version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread rust/lance-table/src/format/manifest.rs Outdated
@wjones127 wjones127 marked this pull request as ready for review October 30, 2025 22:16
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

impl WriterVersion {
/// Try to parse the version string as a semver string. Returns None if
/// not successful.
#[deprecated(note = "Use `lance_lib_version()` instead")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was thinking this could still be useful for non Lance library version as long as they are using semver. But this should be fine to deprecate for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah if we start doing carveouts for other libraries, we can add that back.

@wjones127 wjones127 merged commit 056062a into lance-format:main Oct 31, 2025
26 of 27 checks passed
wjones127 added a commit to wjones127/lance that referenced this pull request Oct 31, 2025
For more context, see:
lance-format#5099 (reply in thread)

---------

Co-authored-by: Claude <noreply@anthropic.com>
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
For more context, see:
lance-format#5099 (reply in thread)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants