From 3c2e694e89b12d6b70d7b1aed3f4dcff169de2da Mon Sep 17 00:00:00 2001 From: Jia-Xuan Liu Date: Thu, 10 Oct 2024 19:56:36 +0800 Subject: [PATCH] refactor tests --- parquet/src/arrow/arrow_reader/mod.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/parquet/src/arrow/arrow_reader/mod.rs b/parquet/src/arrow/arrow_reader/mod.rs index 7d1b8bcf1c51..d3709c03e99a 100644 --- a/parquet/src/arrow/arrow_reader/mod.rs +++ b/parquet/src/arrow/arrow_reader/mod.rs @@ -3130,9 +3130,7 @@ mod tests { assert_eq!( batch .column(0) - .as_any() - .downcast_ref::() - .expect("downcast to string") + .as_string::() .iter() .collect::>(), vec![Some("one"), Some("two"), Some("three")] @@ -3141,22 +3139,14 @@ mod tests { assert_eq!( batch .column(1) - .as_any() - .downcast_ref::() - .expect("downcast to large string") + .as_string::() .iter() .collect::>(), vec![Some("one"), Some("two"), Some("three")] ); assert_eq!( - batch - .column(2) - .as_any() - .downcast_ref::() - .expect("downcast to string view") - .iter() - .collect::>(), + batch.column(2).as_string_view().iter().collect::>(), vec![Some("one"), Some("two"), Some("three")] ); } @@ -3186,8 +3176,7 @@ mod tests { .expect("reader builder with schema") .build() .expect("reader with schema"); - - arrow_reader.next(); + arrow_reader.next().unwrap().unwrap_err(); } #[test]