novemberkilo commented on a change in pull request #955:
URL: https://github.com/apache/arrow-rs/pull/955#discussion_r752848069
##########
File path: arrow/src/compute/kernels/temporal.rs
##########
@@ -47,23 +47,45 @@ macro_rules! extract_component_from_array {
"Expected format [+-]XX:XX".to_string()
)
} else {
- let fixed_offset = match parse(&mut $parsed, $tz,
StrftimeItems::new("%z")) {
- Ok(_) => match $parsed.to_fixed_offset() {
- Ok(fo) => fo,
- err => return_compute_error_with!("Invalid timezone", err),
- },
- _ => match using_chrono_tz($tz) {
- Some(fo) => fo,
- err => return_compute_error_with!("Unable to parse
timezone", err),
- },
- };
for i in 0..$array.len() {
if $array.is_null(i) {
$builder.append_null()?;
} else {
- match $array.$using(i, fixed_offset) {
- Some(dt) => $builder.append_value(dt.$extract_fn() as
i32)?,
- None => $builder.append_null()?,
+ match $array.value_as_datetime(i) {
+ Some(utc) => {
+ let fixed_offset = match parse(
Review comment:
Thanks for picking this up @alamb - I have addressed this in a
subsequent commit.
--
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]