MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881324964


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1661,6 +1660,34 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+/// Casts Utf8 to Boolean
+fn cast_utf8_to_boolean(from: &ArrayRef, cast_options: &CastOptions) -> 
Result<ArrayRef> {
+    let array = from.as_any().downcast_ref::<StringArray>().unwrap();

Review Comment:
   `.unwrap()` method stays in line with all other `cast_` functions that use 
unsafe unwrap as all of them know the type in advance since they're called from 
`cast_with_options` that matches the correct types before calling.



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