alamb commented on code in PR #8971:
URL: https://github.com/apache/arrow-rs/pull/8971#discussion_r2607866761
##########
arrow-cast/src/cast/mod.rs:
##########
@@ -12079,4 +12089,77 @@ mod tests {
// Verify the run-ends were cast correctly (run ends at 3, 6, 9)
assert_eq!(run_array.run_ends().values(), &[3i64, 6i64, 9i64]);
}
+
+ #[test]
+ fn test_cast_time32_second_to_int64() {
+ let array = Time32SecondArray::from(vec![1000, 2000, 3000]);
+ let array = Arc::new(array) as Arc<dyn Array>;
+ let to_type = DataType::Int64;
+ let cast_options = CastOptions::default();
+
+ let result = cast_with_options(&array, &to_type, &cast_options);
Review Comment:
Can we please also add a test that verifies that `can_cast_types` supports
the cast too, similar to
https://github.com/apache/arrow-rs/blob/7e637a7559837b5a0171b23469e9652f2f83364b/arrow-cast/src/cast/mod.rs#L2882-L2881
Something like this maybe:
```rust
assert!(can_cast_types(array.data_type(), &to_type);
```
--
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]