alamb commented on code in PR #9367: URL: https://github.com/apache/arrow-datafusion/pull/9367#discussion_r1504127047
########## datafusion/functions/src/core/nullif.rs: ########## @@ -18,15 +18,15 @@ //! Encoding expressions use arrow::datatypes::DataType; -use datafusion_common::{internal_err, Result, DataFusionError}; +use datafusion_common::{internal_err, DataFusionError, Result}; use datafusion_expr::ColumnarValue; -use datafusion_expr::{ScalarUDFImpl, Signature, Volatility}; -use std::any::Any; use arrow::array::Array; use arrow::compute::kernels::cmp::eq; use arrow::compute::kernels::nullif::nullif; use datafusion_common::ScalarValue; +use datafusion_expr::{ScalarUDFImpl, Signature, Volatility}; Review Comment: The changes in this file are entirely due to `cargo-fmt` being run now ########## datafusion/functions/src/lib.rs: ########## @@ -84,7 +84,11 @@ use log::debug; #[macro_use] pub mod macros; -make_package!(core, "core_expressions", "Core datafusion expressions"); +/// Core datafusion expressions +/// Enabled via feature flag `core_expressions` Review Comment: This is the actual change. If this PR is merged, I will make follow on PR(s) to apply the same treatment to the other modules in `datafusion-functions`. I did only one initially to keep the size of the PR down ########## datafusion/functions/src/macros.rs: ########## @@ -122,6 +122,30 @@ macro_rules! make_package { }; } +/// Macro creates a sub module if the feature is not enabled +/// +/// The rationale for providing stub functions is to help users to configure datafusion +/// properly (so they get an error telling them why a function is not available) +/// instead of getting a cryptic "no function found" message at runtime. + +macro_rules! make_stub_package { Review Comment: This is part of the `make_package` macro which I think keeps most of the "don't repeat yourself" goal but still allows `cargo fmt` to run. Once I port over the other modules to use this pattern, I will remove the `make_package` macro -- 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. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org