Copilot commented on code in PR #591:
URL: https://github.com/apache/sedona-db/pull/591#discussion_r2803928851


##########
rust/sedona-functions/src/sd_format.rs:
##########
@@ -556,6 +633,21 @@ mod tests {
         }
     }
 
+    #[test]
+    fn sd_format_formats_raster_columns() {
+        let udf = sd_format_udf();
+        let tester = ScalarUdfTester::new(udf.into(), vec![RASTER]);
+
+        let raster_array = generate_test_rasters(2, None).unwrap();
+        let result = tester.invoke_array(Arc::new(raster_array)).unwrap();
+        let formatted = result.as_string::<i32>();
+
+        assert_eq!(formatted.value(0),
+            "Raster[w=1, h=2, ul=(1.000000, 2.000000), scale=(0.100000, 
-0.200000), skew=(0.000000, 0.000000), bands=1, outdb=false]"
+        );
+        assert!(formatted.value(1).starts_with("Raster[w=2, h=3"));
+    }

Review Comment:
   The test for raster formatting is missing important test cases that are 
covered for geospatial formatting. Specifically:
   1. Null raster handling (verify that null rasters produce null output)
   2. Width hint truncation (verify that width_hint option correctly truncates 
the output)
   
   Consider adding test cases similar to lines 503-542 which test these 
scenarios for geospatial types. For example, you could test with 
`generate_test_rasters(3, Some(1))` to include a null raster, and test 
width_hint truncation by passing options like `{"width_hint": 10}` to verify 
the output is truncated.



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