tustvold commented on code in PR #3440:
URL: https://github.com/apache/arrow-rs/pull/3440#discussion_r1060810277
##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -2205,4 +2218,13 @@ mod tests {
let c = array.unary_mut(|x| x * 2 + 1).unwrap();
assert_eq!(c, Int32Array::from(vec![Some(11), Some(15), None]));
}
+
+ #[test]
+ #[should_panic(
+ expected = "PrimitiveArray expected ArrayData with type
Interval(MonthDayNano) got Interval(DayTime)"
+ )]
+ fn test_invalid_interval_type() {
+ let array = IntervalDayTimeArray::from(vec![1, 2, 3]);
Review Comment:
This change will also prevent coercing `TimeUnit`, etc... but this is the
only one with potential soundness implications
--
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]