Use strum in the examples (#19126)#19205
Conversation
High-level overviewThis PR introduces |
alamb
left a comment
There was a problem hiding this comment.
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.
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 |
| ExampleKind::TableSample => table_sample::table_sample().await?, | ||
| } | ||
| } | ||
| let example: ExampleKind = std::env::args() |
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?