rok commented on a change in pull request #10334:
URL: https://github.com/apache/arrow/pull/10334#discussion_r633924437
##########
File path: r/tests/testthat/test-Array.R
##########
@@ -291,6 +291,17 @@ test_that("Timezone handling in Arrow roundtrip
(ARROW-3543)", {
expect_identical(read_feather(feather_file), df)
})
+test_that("strptime", {
+ # array of strings
+ time_strings <- Array$create(c("2018-10-07 19:04:05", NA))
+ # array of timestamps (doesn't work if tz="" is added!)
Review comment:
@jorisvandenbossche [it seems
that](https://github.com/apache/arrow/blob/8e43f23dcc6a9e630516228f110c48b64d13cec6/cpp/src/arrow/util/value_parsing.h#L663)
we don't really use or pass zone information even if strptime captures it. The
following passes:
```
options.timestamp_parsers = {TimestampParser::MakeStrptime("%Y-%m-%d
%H:%M:%S %Z")};
AssertConversion<TimestampType, int64_t>(type, {"1970-01-01 00:00:00
Etc/GMT+6,1970-01-01 00:00:00 UTC\n"}, {{0}, {0}}, options);
```
So timestamp's timezone is currently ignored and the local time is returned.
It might be good to document this or even block `%z` and `%Z` to avoid
surprises?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]