Skip to content

ARROW-11708: [Rust] fix Rust 2021 linting warnings#9535

Closed
houqp wants to merge 1 commit intoapache:masterfrom
houqp:qp_rust
Closed

ARROW-11708: [Rust] fix Rust 2021 linting warnings#9535
houqp wants to merge 1 commit intoapache:masterfrom
houqp:qp_rust

Conversation

@houqp
Copy link
Copy Markdown
Member

@houqp houqp commented Feb 20, 2021

Sample warning:

warning: panic message is not a string literal                                                                                                                                                                                 
    --> arrow/src/json/reader.rs:2049:13                                                                                                                                                                                       
     |                                                                                                                                                                                                                         
2049 |             format!("{:?} != {:?}", expected.data(), read.data())                                                                                                                                                       
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                       
     |                                                                                                                                                                                                                         
     = note: `#[warn(non_fmt_panic)]` on by default                                                                                                                                                                            
     = note: this is no longer accepted in Rust 2021 

@github-actions
Copy link
Copy Markdown

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #9535 (696b14d) into master (c100a5c) will decrease coverage by 0.00%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9535      +/-   ##
==========================================
- Coverage   82.27%   82.26%   -0.01%     
==========================================
  Files         244      244              
  Lines       55371    55373       +2     
==========================================
+ Hits        45554    45555       +1     
- Misses       9817     9818       +1     
Impacted Files Coverage Δ
rust/arrow/src/json/reader.rs 83.57% <0.00%> (-0.06%) ⬇️
rust/arrow/src/json/writer.rs 86.17% <0.00%> (ø)
rust/arrow/src/util/test_util.rs 90.90% <0.00%> (ø)
...ion-testing/src/bin/arrow-json-integration-test.rs 0.00% <0.00%> (ø)
rust/arrow/src/record_batch.rs 83.70% <75.00%> (-0.63%) ⬇️
rust/datafusion/src/physical_plan/planner.rs 79.58% <100.00%> (ø)
rust/parquet/src/encodings/encoding.rs 95.05% <0.00%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5647e90...696b14d. Read the comment docs.

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks @houqp

impl Into<StructArray> for RecordBatch {
fn into(self) -> StructArray {
self.schema
impl From<RecordBatch> for StructArray {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good one. 👍

@alamb
Copy link
Copy Markdown
Contributor

alamb commented Feb 20, 2021

Given this is unlikely to be controversial, I am just merging it in as is

@alamb alamb closed this in dbe0b2a Feb 20, 2021
@houqp houqp deleted the qp_rust branch February 20, 2021 19:29
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.26%. Comparing base (c100a5c) to head (696b14d).

Files with missing lines Patch % Lines
rust/arrow/src/json/reader.rs 0.00% 2 Missing ⚠️
rust/arrow/src/json/writer.rs 0.00% 2 Missing ⚠️
rust/arrow/src/util/test_util.rs 0.00% 2 Missing ⚠️
rust/arrow/src/record_batch.rs 75.00% 1 Missing ⚠️
...ion-testing/src/bin/arrow-json-integration-test.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9535      +/-   ##
==========================================
- Coverage   82.27%   82.26%   -0.01%     
==========================================
  Files         244      244              
  Lines       55371    55373       +2     
==========================================
+ Hits        45554    45555       +1     
- Misses       9817     9818       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants