thisisnic commented on issue #29233: URL: https://github.com/apache/arrow/issues/29233#issuecomment-4862714711
Reproducible as of 24.0.0. A quick Claude analysis says: The bug is in [`array_to_vector.cpp:980`](https://github.com/apache/arrow/blob/3f4a04ee9fb40a5db78cb5257b88950599c1c11a/r/src/array_to_vector.cpp#L980): ```cpp std::string tzone = array_type->timezone(); if (tzone.size() > 0) { data.attr("tzone") = tzone; } ``` When the Arrow timestamp has no timezone (empty string), `tzone.size()` is 0, so the `tzone` attribute is never set on the R vector. But in R, `tzone = ""` is the default for `as.POSIXct()` and is meaningful (local timezone) — it's distinct from `tzone` being absent. The write path is correct: [`type_infer.cpp:78`](https://github.com/apache/arrow/blob/3f4a04ee9fb40a5db78cb5257b88950599c1c11a/r/src/type_infer.cpp#L78) passes the empty string through to `timestamp()`. The fix would be to always set the attribute, removing the `if` guard. -- 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]
