-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use strum in the examples (#19126) #19205
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
Use strum in the examples (#19126) #19205
Conversation
High-level overviewThis PR introduces |
alamb
left a comment
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.
Looks good to me -- thank you @cj-zhukov
I ran this script locally and it worked great:
./ci/scripts/rust_example.shI also spot checked that the other commands work as before
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion2$ cargo run --example udf adv_udaf
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.19s
Running `target/debug/examples/udf adv_udaf`
+---------------+
| geo_mean(t.a) |
+---------------+
| 8.0 |
+---------------+
The geometric mean of [2,4,8,64] is 8
+--------------------------+
| simplified_geo_mean(t.a) |
+--------------------------+
| 8.0 |
+--------------------------+
The geometric mean of [2,4,8,64] is 8| prost = { workspace = true } | ||
| rand = { workspace = true } | ||
| serde_json = { workspace = true } | ||
| strum = { workspace = true } |
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.
these are not net new workspace dependencies (see Cargo.lock file) -- we already have them in the workspace. So I think it is ok to add them here
|
I also ran |
|
BTW this PR from @geoffreyclaude adds a few new examples that would also benefit from the strum rewrite treatment: |
|
@cj-zhukov is there any chance you can also apply this pattern to the examples from I don't think it is necessary / we could do it as a follow on PR, but it would be nice to have all the examples consistent |
sure, let's do it |
|
@alamb I updated |
alamb
left a comment
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.
Thanks again @cj-zhukov
| ExampleKind::TableSample => table_sample::table_sample().await?, | ||
| } | ||
| } | ||
| let example: ExampleKind = std::env::args() |
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.
❤️
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?