Skip to content

Comments

refactor: simplify table feature parsing#1878

Merged
scovich merged 4 commits intodelta-io:mainfrom
scovich:feature-name-parsing
Feb 19, 2026
Merged

refactor: simplify table feature parsing#1878
scovich merged 4 commits intodelta-io:mainfrom
scovich:feature-name-parsing

Conversation

@scovich
Copy link
Collaborator

@scovich scovich commented Feb 18, 2026

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 (impl FromString and TryFrom, 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 mimicks Into. We can't "just" impl From for TableFeature because the blanket impl<T: From> TryFrom for T conflicts with the impl TryFrom for TableFeature strum 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 TableFeature instead).

See also

How was this change tested?

Updated unit tests.

@scovich scovich requested a review from DrakeLin February 18, 2026 16:06
@github-actions github-actions bot added the breaking-change Change that require a major version bump label Feb 18, 2026
@scovich scovich removed the breaking-change Change that require a major version bump label Feb 18, 2026
@github-actions github-actions bot added the breaking-change Change that require a major version bump label Feb 18, 2026
@scovich scovich removed the breaking-change Change that require a major version bump label Feb 18, 2026
@github-actions github-actions bot added the breaking-change Change that require a major version bump label Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.88%. Comparing base (0c27272) to head (8e385c2).
⚠️ Report is 1 commits behind head on main.

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.
📢 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 on lines +801 to +802
for feature in TableFeature::iter() {
let expected = match feature {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

EnumIter + exhaustive match ensures that all present and future features are covered. Which also eliminates the need for two separate tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice!

@n3nash n3nash requested review from sanujbasu and scottsand-db and removed request for OussamaSaoudi February 18, 2026 18:19
Copy link
Collaborator

@scottsand-db scottsand-db left a comment

Choose a reason for hiding this comment

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

Neat fix! Thanks. LGTM

Copy link
Collaborator

@DrakeLin DrakeLin left a comment

Choose a reason for hiding this comment

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

looks great, thanks for the change

@github-actions github-actions bot removed the breaking-change Change that require a major version bump label Feb 19, 2026
@scovich scovich merged commit 7a171fe into delta-io:main Feb 19, 2026
22 checks passed
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