-
Couldn't load subscription status.
- Fork 118
feat: Convert DV storage_type to enum
#1366
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: Convert DV storage_type to enum
#1366
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
76013c6 to
bb2d651
Compare
bb2d651 to
7404837
Compare
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.
Awesome, solid improvement LGTM thank you!
| 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 | ||
| ))), | ||
| } | ||
| } | ||
| } |
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.
I think we could use strum for this (as we do with some other enums IIRC) but not a huge opinion
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.