You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/20 17:55:14 UTC

[GitHub] [arrow-datafusion] WinkerDu opened a new pull request, #2295: MINOR: beautify code with neat idents

WinkerDu opened a new pull request, #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   Careless idents exists in Some macro code of `scalar.rs`
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   Beautify this code with neat idents.
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   No.
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
alamb merged PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1105584178

   Thank you for this contribution @WinkerDu 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] yjshen commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
yjshen commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1104759989

   We do have MIRI checks that rely on nightly here: https://github.com/apache/arrow-datafusion/blob/master/.github/workflows/rust.yml#L356-L388.
   
   What do you think if we have a macro check with rust nightly in CI as well?


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1105608534

   Thanks for looking into the CI


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] WinkerDu commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
WinkerDu commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1105614789

   Thank you all ❤️ 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] WinkerDu commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
WinkerDu commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1104785465

   > We do have MIRI checks that rely on nightly here: https://github.com/apache/arrow-datafusion/blob/master/.github/workflows/rust.yml#L356-L388.
   > 
   > What do you think if we have a macro check with rust nightly in CI as well?
   
   Sounds reasonable, I will try it later


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] yjshen commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
yjshen commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1104631640

   Is it possible to replicate your effort at https://github.com/apache/arrow-datafusion/pull/2033 here, to fix existing problems and prevent further violations?


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] WinkerDu commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
WinkerDu commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1104746585

   @yjshen 
   I tried to set following configuration to `rustfmt.toml` (see [format_macro_matchers](https://rust-lang.github.io/rustfmt/?version=master&search=#format_macro_matchers) [format_macro_bodies](https://rust-lang.github.io/rustfmt/?version=master&search=#format_macro_bodies) )
   ```
   format_macro_matchers = true
   format_macro_bodies = true
   ```
   then run `cargo fmt --all -- --check`, some warning messages raise
   ```
   Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
   Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
   ```
   Hope to get some suggestions, thank you
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] WinkerDu commented on pull request #2295: MINOR: beautify code with neat idents

Posted by GitBox <gi...@apache.org>.
WinkerDu commented on PR #2295:
URL: https://github.com/apache/arrow-datafusion/pull/2295#issuecomment-1105596532

   @yjshen 
   I run `cargo +nightly fmt -- --config format_macro_bodies=true --config format_macro_matchers=true --check`
   Checking result is disappointing:
   - No idents violation detect, such as https://github.com/apache/arrow-datafusion/blob/41b4e491663029f653e491b110d0b5e74d08a0b6/datafusion/common/src/scalar.rs#L771-L795
   - Some metavariables format result is as unexpected, such as
   ```
   Diff in /Users/duripeng/code/arrow-datafusion/arrow-datafusion/datafusion/physical-expr/src/tdigest/mod.rs at line 681:
        // A macro to assert the specified `quantile` estimated by `t` is within the
        // allowable relative error bound.
        macro_rules! assert_error_bounds {
   -        ($t:ident, quantile = $quantile:literal, want = $want:literal) => {
   +        ($t:ident,quantile = $quantile:literal,want = $want:literal) => {
                assert_error_bounds!(
                    $t,
                    quantile = $quantile,
   Diff in /Users/duripeng/code/arrow-datafusion/arrow-datafusion/datafusion/physical-expr/src/tdigest/mod.rs at line 689:
                    allowable_error = 0.01
                )
            };
   -        ($t:ident, quantile = $quantile:literal, want = $want:literal, allowable_error = $re:literal) => {
   +        (
   +            $t:ident,quantile =
   +            $quantile:literal,want =
   +            $want:literal,allowable_error =
   +            $re:literal
   +        ) => {
                let ans = $t.estimate_quantile($quantile);
                let expected: f64 = $want;
                let percentage: f64 = (expected - ans).abs() / expected;
   ```
   
   IMO, it's better not to import macro format check for now, and just merge this pr for easily reading code?
   How do you think about it?


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org