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/02/05 01:48:39 UTC

[GitHub] [arrow-rs] HaoYang670 opened a new pull request #1273: Fix some clippy lints in parquet crate

HaoYang670 opened a new pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273


   # 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.
   -->
   
   Partially close #1254.
   
   # 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.
   -->
   
   In this PR, we remove some disabled clippy lints and refactor the code, which includes:
   - vec_init_then_push
   - upper_case_acronyms
   - transmute_ptr_ti_ptr
   - same_item_push
   - approx_constant
   - cast_ptr_alignment
   - float_cmp
   - float_equality_without_abs
   - incomplete_features
   - single_char_names
   - needless_range_loop
   
   # 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.
   -->
   
   # Are there any user-facing changes?
   
   
   <!---
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   Some enums are renamed.


-- 
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-rs] codecov-commenter commented on pull request #1273: Fix some clippy lints in parquet crate

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#issuecomment-1030495685


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1273](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (20f4237) into [master](https://codecov.io/gh/apache/arrow-rs/commit/43299cc3b9e4a0a7120fc9870f2e0e2d7d8746a0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (43299cc) will **decrease** coverage by `0.00%`.
   > The diff coverage is `91.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/1273/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1273      +/-   ##
   ==========================================
   - Coverage   83.02%   83.02%   -0.01%     
   ==========================================
     Files         180      180              
     Lines       52269    52270       +1     
   ==========================================
   - Hits        43398    43397       -1     
   - Misses       8871     8873       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [parquet/src/arrow/record\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYXJyb3cvcmVjb3JkX3JlYWRlci5ycw==) | `93.43% <66.66%> (-0.65%)` | :arrow_down: |
   | [parquet/src/encodings/levels.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2xldmVscy5ycw==) | `93.41% <94.73%> (+0.36%)` | :arrow_up: |
   | [parquet/src/data\_type.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZGF0YV90eXBlLnJz) | `76.49% <100.00%> (-0.12%)` | :arrow_down: |
   | [parquet/src/encodings/decoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2RlY29kaW5nLnJz) | `90.45% <100.00%> (ø)` | |
   | [parquet/src/encodings/encoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2VuY29kaW5nLnJz) | `93.71% <100.00%> (ø)` | |
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldF9kZXJpdmUvc3JjL3BhcnF1ZXRfZmllbGQucnM=) | `66.21% <0.00%> (-0.23%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [43299cc...20f4237](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-rs] alamb commented on a change in pull request #1273: Fix some clippy lints in parquet crate, rename `LevelEncoder` variants to conform to Rust standards

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#discussion_r801559433



##########
File path: parquet/src/encodings/levels.rs
##########
@@ -50,11 +50,11 @@ pub fn max_buffer_size(
 }
 
 /// Encoder for definition/repetition levels.
-/// Currently only supports RLE and BIT_PACKED (dev/null) encoding, including v2.
+/// Currently only supports Rle and BitPacked (dev/null) encoding, including v2.
 pub enum LevelEncoder {

Review comment:
       cc @tustvold 




-- 
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-rs] codecov-commenter edited a comment on pull request #1273: Fix some clippy lints in parquet crate

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#issuecomment-1030495685


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1273](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e569ea3) into [master](https://codecov.io/gh/apache/arrow-rs/commit/ce15d0cd7bad127799f3f0d5845e2a0267e670a9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ce15d0c) will **decrease** coverage by `0.00%`.
   > The diff coverage is `95.23%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/1273/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1273      +/-   ##
   ==========================================
   - Coverage   83.02%   83.02%   -0.01%     
   ==========================================
     Files         180      180              
     Lines       52269    52262       -7     
   ==========================================
   - Hits        43394    43388       -6     
   + Misses       8875     8874       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [parquet/src/record/reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvcmVjb3JkL3JlYWRlci5ycw==) | `89.83% <ø> (ø)` | |
   | [parquet/src/arrow/record\_reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYXJyb3cvcmVjb3JkX3JlYWRlci5ycw==) | `93.43% <66.66%> (-0.65%)` | :arrow_down: |
   | [parquet/src/encodings/levels.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2xldmVscy5ycw==) | `93.41% <94.73%> (+0.36%)` | :arrow_up: |
   | [parquet/src/arrow/schema.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYXJyb3cvc2NoZW1hLnJz) | `85.56% <100.00%> (ø)` | |
   | [parquet/src/data\_type.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZGF0YV90eXBlLnJz) | `76.49% <100.00%> (-0.12%)` | :arrow_down: |
   | [parquet/src/encodings/decoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2RlY29kaW5nLnJz) | `90.45% <100.00%> (ø)` | |
   | [parquet/src/encodings/encoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2VuY29kaW5nLnJz) | `93.71% <100.00%> (+0.19%)` | :arrow_up: |
   | [parquet/src/encodings/rle.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL3JsZS5ycw==) | `92.62% <100.00%> (-0.08%)` | :arrow_down: |
   | [parquet/src/file/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZmlsZS93cml0ZXIucnM=) | `93.30% <100.00%> (ø)` | |
   | [parquet/src/record/api.rs](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvcmVjb3JkL2FwaS5ycw==) | `91.65% <100.00%> (ø)` | |
   | ... and [6 more](https://codecov.io/gh/apache/arrow-rs/pull/1273/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ce15d0c...e569ea3](https://codecov.io/gh/apache/arrow-rs/pull/1273?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-rs] HaoYang670 commented on pull request #1273: Fix some clippy lints in parquet crate

Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#issuecomment-1032116446


   Yes, ready for review.


-- 
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-rs] tustvold commented on a change in pull request #1273: Fix some clippy lints in parquet crate, rename `LevelEncoder` variants to conform to Rust standards

Posted by GitBox <gi...@apache.org>.
tustvold commented on a change in pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#discussion_r801586940



##########
File path: parquet/src/encodings/levels.rs
##########
@@ -50,11 +50,11 @@ pub fn max_buffer_size(
 }
 
 /// Encoder for definition/repetition levels.
-/// Currently only supports RLE and BIT_PACKED (dev/null) encoding, including v2.
+/// Currently only supports Rle and BitPacked (dev/null) encoding, including v2.
 pub enum LevelEncoder {

Review comment:
       The encodings module is experimental and so this isn't actually a breaking change. Clippy ignores proposing breaking changes to the API (at least for this lint because the salt was strong).




-- 
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-rs] alamb commented on a change in pull request #1273: Fix some clippy lints in parquet crate

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#discussion_r801556200



##########
File path: parquet/src/encodings/decoding.rs
##########
@@ -1340,11 +1340,11 @@ mod tests {
         #[allow(clippy::wrong_self_convention)]
         fn to_byte_array(data: &[bool]) -> Vec<u8> {
             let mut v = vec![];
-            for i in 0..data.len() {
+            for (i, item) in data.iter().enumerate() {
                 if i % 8 == 0 {
                     v.push(0);
                 }
-                if data[i] {
+                if *item {

Review comment:
       this type of change is not only more "idiomatic" I think it will also be faster (as bounds checks aren't being done on each access of `data` 👍 )

##########
File path: parquet/src/encodings/levels.rs
##########
@@ -50,11 +50,11 @@ pub fn max_buffer_size(
 }
 
 /// Encoder for definition/repetition levels.
-/// Currently only supports RLE and BIT_PACKED (dev/null) encoding, including v2.
+/// Currently only supports Rle and BitPacked (dev/null) encoding, including v2.
 pub enum LevelEncoder {

Review comment:
       This is technically a breaking API change, but I think it is ok

##########
File path: parquet/src/lib.rs
##########
@@ -30,24 +30,13 @@
 //!
 //! 3. [arrow::async_reader] for `async` reading and writing parquet
 //! files to Arrow `RecordBatch`es (requires the `async` feature).
-#![allow(incomplete_features)]
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
 #![allow(

Review comment:
       🎉 




-- 
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-rs] alamb commented on pull request #1273: Fix some clippy lints in parquet crate

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273#issuecomment-1031558589


   @HaoYang670  this PR is marked "draft" - is it ready for review?


-- 
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-rs] alamb merged pull request #1273: Fix some clippy lints in parquet crate, rename `LevelEncoder` variants to conform to Rust standards

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #1273:
URL: https://github.com/apache/arrow-rs/pull/1273


   


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