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

fix: fix several situations where we were incorrectly inferring the storage version #2756

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

westonpace
Copy link
Contributor

This could lead to corrupt datasets with a mix of v1 and v2 files.

@github-actions github-actions bot added bug Something isn't working python labels Aug 19, 2024
Comment on lines 441 to 445
if has_deprecated_v2_feature_flag(p.writer_feature_flags) {
DataStorageFormat::new(LanceFileVersion::Legacy)
} else {
DataStorageFormat::new(LanceFileVersion::Stable)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this backwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Let me make some migration tests for these cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I added some regression test cases (confirmed they detected this) and switched the logic (now tests pass)

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 61.97183% with 27 lines in your changes missing coverage. Please review.

Project coverage is 79.19%. Comparing base (7a36b28) to head (849d48a).

Files Patch % Lines
rust/lance/src/dataset/transaction.rs 68.75% 6 Missing and 4 partials ⚠️
rust/lance-encoding/src/version.rs 41.66% 7 Missing ⚠️
rust/lance-table/src/format/fragment.rs 72.72% 4 Missing and 2 partials ⚠️
rust/lance-table/src/format/manifest.rs 20.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2756      +/-   ##
==========================================
- Coverage   79.20%   79.19%   -0.01%     
==========================================
  Files         227      227              
  Lines       67573    67635      +62     
  Branches    67573    67635      +62     
==========================================
+ Hits        53521    53564      +43     
- Misses      10954    10970      +16     
- Partials     3098     3101       +3     
Flag Coverage Δ
unittests 79.19% <61.97%> (-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.

python/python/tests/historical_datasets/README.md Outdated Show resolved Hide resolved
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 move these to the test_data folder, like the other datasets? https://github.com/lancedb/lance/tree/main/test_data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Thanks!

@westonpace westonpace merged commit 987561f into lancedb:main Aug 19, 2024
22 checks passed
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.

4 participants