alamb commented on code in PR #9158:
URL: https://github.com/apache/arrow-rs/pull/9158#discussion_r2686952968
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -1814,4 +1822,46 @@ mod tests {
assert_eq!(lengths_iter.next(), None, "Should not have more lengths");
}
+
+ #[should_panic(expected = "Mismatched data type, expected Utf8View, got
BinaryView")]
+ #[test]
+ fn invalid_casting_from_array_data() {
+ // Should not be able to cast to StringViewArray due to invalid UTF-8
+ let array_data =
binary_view_array_with_invalid_utf8_data().into_data();
+ let _ = StringViewArray::from(array_data);
+ }
+
+ #[should_panic(expected = "invalid utf-8 sequence")]
+ #[test]
+ fn invalid_array_data() {
Review Comment:
This test also fails on main but I wanted to make it super clear you can't
build an invalid Utf8ViewArray with the ArrayDataBuilder (as expected)
--
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]