You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/29 12:08:24 UTC

[GitHub] [arrow-datafusion] retikulum commented on a diff in pull request #4004: Improve Error Handling and Readibility for downcasting `Date32Array`

retikulum commented on code in PR #4004:
URL: https://github.com/apache/arrow-datafusion/pull/4004#discussion_r1008689504


##########
datafusion/row/src/writer.rs:
##########
@@ -326,8 +327,10 @@ pub(crate) fn write_field_date32(
     col_idx: usize,
     row_idx: usize,
 ) {
-    let from = from.as_any().downcast_ref::<Date32Array>().unwrap();
-    to.set_date32(col_idx, from.value(row_idx));
+    match as_date32_array(from) {
+        Ok(from) => to.set_date32(col_idx, from.value(row_idx)),
+        Err(e) => println!("{}", e),

Review Comment:
   It seems reasonable to me. I will fix it and be more careful in future PRs.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org