AlenkaF commented on a change in pull request #10334:
URL: https://github.com/apache/arrow/pull/10334#discussion_r633329285
##########
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:
I haven't figured out yet how to pass `tz` argument to `strptime_arrow `
wrapper function as it is written now. After going through your comments,
making the necessary changes then it will not be an issue I think.
##########
File path: r/R/compute.R
##########
@@ -286,3 +286,8 @@ cast_options <- function(safe = TRUE, ...) {
)
modifyList(opts, list(...))
}
+
+strptime_arrow <- function(..., format, unit){
Review comment:
Got it.
Arrow function uses `format` and `unit` as an FunctionOption if I understand
correctly, haven't found `tz` yet.
I think they should have defaults, yes: `format = "%Y-%m-%d %H:%M:%S"` and
`unit = TimeUnit$MICRO/2L/"us"`.
##########
File path: r/src/compute.cpp
##########
@@ -233,6 +233,12 @@ std::shared_ptr<arrow::compute::FunctionOptions>
make_compute_options(
max_replacements);
}
+ if (func_name == "strptime") {
+ using Options = arrow::compute::StrptimeOptions;
Review comment:
Do I understand correctly that in `scalar_string.cc` line 1744 would
suggest `StrptimeOptions` do not have `Defaults()` in C++?
--
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]