-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Run cargo-fmt on datafusion-functions/core
#9367
Conversation
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}; |
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.
The changes in this file are entirely due to cargo-fmt
being run now
@@ -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` |
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.
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
/// 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 { |
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.
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
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.
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.
Nice 👍
I think the problem is rust-lang/rustfmt#3253 -- specifically if you use a macro to define a module This code was previously using a macro to create code like mod core; |
Here is the follow on PR to run rustfmt on all the modules: #9390 |
Which issue does this PR close?
Part of #9281
Rationale for this change
cargo fmt
is not run on much of the code in datafusion-functions due to rust-lang/rustfmt#3253, As @jonahgao foundThis makes PRs larger than necessary and misses all the benefits of cargo-fmt
What changes are included in this PR?
datafusion-functions/core
module is declared using a direct conditional include so it it is visible to rust-fmtcargo fmt
and check in the resulting formatting changes in coreAre these changes tested?
Yes, by CI
Are there any user-facing changes?
No, this is an internal development process change