alamb commented on code in PR #7280:
URL: https://github.com/apache/arrow-datafusion/pull/7280#discussion_r1294965716
##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -3343,6 +3036,20 @@ mod tests {
assert_eq!(result, &UInt64Array::from_value(2, 1));
}
+ #[test]
+ fn test_check_invalid_datatypes() {
+ let data = vec![Some(vec![Some(1), Some(2), Some(3)])];
+ let list_array =
+ Arc::new(ListArray::from_iter_primitive::<Int64Type, _, _>(data))
as ArrayRef;
+ let int64_array = Arc::new(StringArray::from(vec![Some("string")])) as
ArrayRef;
+
+ let args = [list_array, int64_array];
+
+ let array = array_append(&args);
+
+ assert!(array.is_err());
Review Comment:
You might also want to check that the error is as expected with something
like:
```suggestion
assert!(array.unwrap_err().to_string(), "Expected error message");
```
--
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]