Commits


Mike Seddon authored and Andrew Lamb committed cc49beb8284
ARROW-11775: [Rust][DataFusion] Feature Flags for Dependencies @alamb @andygrove @nevi-me Based on the Rust Arrow sync call we discussed setting feature flags to allow use of DataFusion without having to pull in unnecessary dependencies. Here is an example applied to the crypto functions. It: - puts the crypto functions behind a feature flag called `crypto-functions` with the required dependencies tagged. - adds the `crypto-functions` to the `default` feature flag meaning it will be included in the default build. - adds tests for both states of the feature flag. Note that the cargo behavior of specifying conditions in the rust test framework is inverted (at least in my mind) so that you can only specify `ignore` not `include` rules. Practically this means to run the test with the feature flag you do: `#[cfg_attr(not(feature = "crypto-functions"), ignore)]` which is not ideal but functional. - currently I am throwing `Err(DataFusionError::Internal("requires compilation with feature flag: crypto-functions".to_string()))` errors which I think is a better user experience than `panic` based macros but this could easily be changed to `unimplemented!` with a similar message. - unfortunately we will probably need to execute `cargo test --no-default-features --features cli` AND `cargo test` in CICD to ensure the proper coverage (`--features cli` is required to compile). Thoughts? Closes #9567 from seddonm1/feature-flags Authored-by: Mike Seddon <seddonm1@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>