seddonm1 opened a new pull request #9567:
URL: https://github.com/apache/arrow/pull/9567


   @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?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to