zhuqi-lucas commented on code in PR #7534:
URL: https://github.com/apache/arrow-rs/pull/7534#discussion_r2099260107


##########
arrow-cast/src/display.rs:
##########
@@ -1234,4 +1249,32 @@ mod tests {
             array_value_to_string(&map_array, 3).unwrap()
         );
     }
+
+    #[test]
+    fn duration_pretty_and_iso_extremes() {
+        // Build [MIN, MAX, 3661, NULL]
+        let arr = DurationSecondArray::from(vec![Some(i64::MIN), 
Some(i64::MAX), Some(3661), None]);
+        let array: ArrayRef = Arc::new(arr);
+
+        // Pretty formatting
+        let opts = FormatOptions::default().with_null("<NULL>");
+        let opts = opts.with_duration_format(DurationFormat::Pretty);
+        let pretty = pretty_format_columns_with_options("pretty", 
&[array.clone()], &opts)
+            .unwrap()
+            .to_string();
+        assert_eq!(pretty.matches("<invalid>").count(), 2);
+        assert!(pretty.contains("0 days 1 hours 1 mins 1 secs"));
+        assert!(pretty.contains("<NULL>"));

Review Comment:
   Addressed in latest PR, thanks @alamb!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to