refactor: simplify table feature parsing#1878
Merged
scovich merged 4 commits intodelta-io:mainfrom Feb 19, 2026
Merged
Conversation
scovich
commented
Feb 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1878 +/- ##
==========================================
- Coverage 85.88% 85.88% -0.01%
==========================================
Files 139 139
Lines 40065 40030 -35
Branches 40065 40030 -35
==========================================
- Hits 34410 34379 -31
+ Misses 4159 4158 -1
+ Partials 1496 1493 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
scovich
commented
Feb 18, 2026
Comment on lines
+801
to
+802
| for feature in TableFeature::iter() { | ||
| let expected = match feature { |
Collaborator
Author
There was a problem hiding this comment.
EnumIter + exhaustive match ensures that all present and future features are covered. Which also eliminates the need for two separate tests.
scottsand-db
approved these changes
Feb 18, 2026
Collaborator
scottsand-db
left a comment
There was a problem hiding this comment.
Neat fix! Thanks. LGTM
DrakeLin
approved these changes
Feb 18, 2026
Collaborator
DrakeLin
left a comment
There was a problem hiding this comment.
looks great, thanks for the change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
There's a semantic gap in strum's
EnumString: The parsing API it derives is always fallible (implFromStringandTryFrom, both with strum parsing error), but enums with a default variant have infallible parsing (because any unknown value goes into the default).Define and use a new trait,
IntoTableFeature, which mimicksInto. We can't "just" impl From for TableFeature because the blanketimpl<T: From> TryFrom for Tconflicts with theimpl TryFrom for TableFeaturestrum emits.Result: Code that works with table features no longer needs to parse+unwrap, and there's now a narrow waist to update some day if/when this gets fixed upstream (just remove the extension trait and
impl From for TableFeatureinstead).See also
How was this change tested?
Updated unit tests.