alamb commented on code in PR #3514:
URL: https://github.com/apache/arrow-rs/pull/3514#discussion_r1091827266


##########
arrow-cast/src/display.rs:
##########
@@ -133,57 +140,176 @@ macro_rules! make_string_interval_month_day_nano {
 }
 
 macro_rules! make_string_date {
-    ($array_type:ty, $column: ident, $row: ident) => {{
-        let array = $column.as_any().downcast_ref::<$array_type>().unwrap();
+    ($array_type:ty, $dt:expr, $column: ident, $col_idx:ident, $row_idx: 
ident) => {{
+        Ok($column
+            .as_any()
+            .downcast_ref::<$array_type>()
+            .ok_or_else(|| invalid_cast_error($dt, $col_idx, $row_idx))?
+            .value_as_date($row_idx)
+            .ok_or_else(|| invalid_cast_error($dt, $col_idx, $row_idx))?
+            .to_string())
+    }};
+}
 
-        Ok(array
-            .value_as_date($row)
-            .map(|d| d.to_string())
-            .unwrap_or_else(|| "ERROR CONVERTING DATE".to_string()))

Review Comment:
   Yes, please, let's keep the existing behavior
   
   I think https://github.com/apache/arrow-rs/issues/3638 will result in a way 
to eventually control what happens on invalid data (e.g. error or placeholder) 
so I think we should avoid changing the behavior in this PR



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