alamb opened a new issue, #5182:
URL: https://github.com/apache/arrow-rs/issues/5182
**Describe the bug**
Timstamps like `2023-12-05T21:58:10.45ZZTOP` which are invalid (they have
trailing content after the `Z`) should error when parsing (casting from String
to Timestamp) but instead they ignore the trailing content
**To Reproduce**
This test case should pass in arrow-cast/src/cast.rs
```rust
#[test]
fn test_cast_string_to_timestamp_invalid_tz() {
// content after Z should be ignored
let bad_timestamp = "2023-12-05T21:58:10.45ZZTOP";
let array = StringArray::from(vec![Some(bad_timestamp)]);
let data_types = [
DataType::Timestamp(TimeUnit::Second, None),
DataType::Timestamp(TimeUnit::Millisecond, None),
DataType::Timestamp(TimeUnit::Microsecond, None),
DataType::Timestamp(TimeUnit::Nanosecond, None),
];
for dt in data_types {
assert_eq!(
cast(&array, &dt).unwrap_err().to_string(),
"Invalid timezone: ZZTOP"
);
}
}
```
**Expected behavior**
Test case should pass, instead it fails as the timestamp is correctly parsed
**Additional context**
Found upstream in https://github.com/apache/arrow-datafusion/issues/8452
--
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]