Skip to content

Conversation

@Fokko
Copy link
Collaborator

@Fokko Fokko commented Oct 2, 2025

What changes are proposed in this pull request?

I've been playing around with the Deletion Vectors, and I thought it would be a nice touch to convert the string to an enum. This makes the code more readable and avoids the catch-all branch in the pattern matching.

How was this change tested?

Existing tests.

@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (9eee114) to head (a4edbc9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kernel/src/actions/deletion_vector.rs 95.89% 2 Missing and 1 partial ⚠️
kernel/src/actions/visitors.rs 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1366      +/-   ##
==========================================
+ Coverage   84.83%   84.87%   +0.04%     
==========================================
  Files         113      113              
  Lines       28735    28796      +61     
  Branches    28735    28796      +61     
==========================================
+ Hits        24376    24442      +66     
+ Misses       3203     3197       -6     
- Partials     1156     1157       +1     

☔ 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.

@Fokko Fokko force-pushed the fd-convert-dv-storage-type-to-enum branch 2 times, most recently from 76013c6 to bb2d651 Compare October 2, 2025 18:00
@Fokko Fokko force-pushed the fd-convert-dv-storage-type-to-enum branch from bb2d651 to 7404837 Compare October 2, 2025 18:13
Copy link
Member

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

Awesome, solid improvement LGTM thank you!

Comment on lines +28 to +42
impl FromStr for DeletionVectorStorageType {
type Err = Error;

fn from_str(s: &str) -> DeltaResult<Self> {
match s {
"u" => Ok(Self::PersistedRelative),
"i" => Ok(Self::Inline),
"p" => Ok(Self::PersistedAbsolute),
_ => Err(Error::internal_error(format!(
"Unsupported deletion vector format option: {}",
s
))),
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we could use strum for this (as we do with some other enums IIRC) but not a huge opinion

@zachschuermann zachschuermann merged commit 0084948 into delta-io:main Oct 3, 2025
21 checks passed
@Fokko Fokko deleted the fd-convert-dv-storage-type-to-enum branch October 4, 2025 09:00
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.

3 participants