From efe8af4e19a2a68e1b0f662f5d97aeb3cd35e0af Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 16 Dec 2024 16:24:36 -0500 Subject: [PATCH 1/4] Minor: make it easier to find instructions when fmt fails --- .github/workflows/rust.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ff5040fd294..22c95e5075b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -101,12 +101,13 @@ jobs: - name: Format arrow run: cargo fmt --all -- --check - name: Format parquet - # Many modules in parquet are skipped, so check parquet separately. If this check fails, run: - # cargo fmt -p parquet -- --config skip_children=true `find ./parquet -name "*.rs" \! -name format.rs` - # from the top level arrow-rs directory and check in the result. + # Many modules in parquet are skipped, so check parquet separately # https://github.com/apache/arrow-rs/issues/6179 working-directory: parquet - run: cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs` + run: | + # if this fails, run this from the parquet directory: + # cargo fmt -p parquet -- --config skip_children=true `find ./parquet -name "*.rs" \! -name format.rs` + cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs` - name: Format object_store working-directory: object_store run: cargo fmt --all -- --check From 440e52079135df85128b15936425d2b5af488007 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 16 Dec 2024 16:26:40 -0500 Subject: [PATCH 2/4] purposely introduce a fmt issue --- parquet/src/arrow/schema/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/parquet/src/arrow/schema/mod.rs b/parquet/src/arrow/schema/mod.rs index 26b0d8b7b88..5b24d98d2e0 100644 --- a/parquet/src/arrow/schema/mod.rs +++ b/parquet/src/arrow/schema/mod.rs @@ -249,9 +249,7 @@ pub fn arrow_to_parquet_schema_with_root( Ok(SchemaDescriptor::new(Arc::new(group))) } -fn parse_key_value_metadata( - key_value_metadata: Option<&Vec>, -) -> Option> { +fn parse_key_value_metadata(key_value_metadata: Option<&Vec>) -> Option> { match key_value_metadata { Some(key_values) => { let map: HashMap = key_values From 3da1765b7cb76f3e7d851b509362dd3e8d982b73 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 16 Dec 2024 16:31:23 -0500 Subject: [PATCH 3/4] Revert "purposely introduce a fmt issue" This reverts commit 440e52079135df85128b15936425d2b5af488007. --- parquet/src/arrow/schema/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parquet/src/arrow/schema/mod.rs b/parquet/src/arrow/schema/mod.rs index 5b24d98d2e0..26b0d8b7b88 100644 --- a/parquet/src/arrow/schema/mod.rs +++ b/parquet/src/arrow/schema/mod.rs @@ -249,7 +249,9 @@ pub fn arrow_to_parquet_schema_with_root( Ok(SchemaDescriptor::new(Arc::new(group))) } -fn parse_key_value_metadata(key_value_metadata: Option<&Vec>) -> Option> { +fn parse_key_value_metadata( + key_value_metadata: Option<&Vec>, +) -> Option> { match key_value_metadata { Some(key_values) => { let map: HashMap = key_values From 371d281b7fa73b6f1b53b5e53abefb53836f1ce7 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 17 Dec 2024 06:51:12 -0500 Subject: [PATCH 4/4] Update .github/workflows/rust.yml Co-authored-by: Ed Seidl --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 22c95e5075b..72a53263d33 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -106,7 +106,7 @@ jobs: working-directory: parquet run: | # if this fails, run this from the parquet directory: - # cargo fmt -p parquet -- --config skip_children=true `find ./parquet -name "*.rs" \! -name format.rs` + # cargo fmt -p parquet -- --config skip_children=true `find . -name "*.rs" \! -name format.rs` cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs` - name: Format object_store working-directory: object_store