-
Notifications
You must be signed in to change notification settings - Fork 113
chore: Move literal expression transform to a visitor #1268
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
base: main
Are you sure you want to change the base?
Conversation
After delta-io#1207 I thought it would be a nice touch to move the traversal of the schema to a visitor, which creates a very nice separation between flow and the actual logic.
a4e7810
to
1fb0a59
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1268 +/- ##
==========================================
- Coverage 83.54% 83.53% -0.01%
==========================================
Files 106 107 +1
Lines 25537 25566 +29
Branches 25537 25566 +29
==========================================
+ Hits 21334 21356 +22
- Misses 3144 3150 +6
- Partials 1059 1060 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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'll let core team comment if they want this abstraction. it certainly seems nice to reduce the need to macros with business logic.
Another option which seems like might fit well is a straight iterator (this might get into some complicated stack handling for this case). I created something like this for Java: https://github.com/delta-io/delta/blob/master/kernel/kernel-api/src/main/java/io/delta/kernel/internal/util/SchemaIterable.java
While working on delta-io#1268 I think the StructType could be improved by making it iterable.
While working on delta-io#1268 I think the StructType could be improved by making it iterable.
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md 2. Run `cargo t --all-features --all-targets` to get started testing, and run `cargo fmt`. 3. Ensure you have added or run the appropriate tests for your PR. 4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 5. Be sure to keep the PR description updated to reflect all changes. --> <!-- PR title formatting: This project uses conventional commits: https://www.conventionalcommits.org/ Each PR corresponds to a commit on the `main` branch, with the title of the PR (typically) being used for the commit message on main. In order to ensure proper formatting in the CHANGELOG please ensure your PR title adheres to the conventional commit specification. Examples: - new feature PR: "feat: new API for snapshot.update()" - bugfix PR: "fix: correctly apply DV in read-table example" --> ## What changes are proposed in this pull request? While working on #1268 I think the StructType could be improved by making it iterable. <!-- Please clarify what changes you are proposing and why the changes are needed. The purpose of this section is to outline the changes, why they are needed, and how this PR fixes the issue. If the reason for the change is already explained clearly in an issue, then it does not need to be restated here. 1. If you propose a new API or feature, clarify the use case for a new API or feature. 2. If you fix a bug, you can clarify why it is a bug. --> <!-- Uncomment this section if there are any changes affecting public APIs: ### This PR affects the following public APIs If there are breaking changes, please ensure the `breaking-changes` label gets added by CI, and describe why the changes are needed. Note that _new_ public APIs are not considered breaking. --> ## How was this change tested? <!-- Please make sure to add test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested, ideally via a reproducible test documented in the PR description. --> Added new tests 👍
What changes are proposed in this pull request?
After #1207 I thought it would be a nice touch to move the traversal of the schema to a visitor, which creates a very nice separation between flow and the actual logic. Also, this reduces the state within the class by removing the error and stack.
I'm still learning rust, so don't hold back on the review.
How was this change tested?
Existing tests