rok commented on code in PR #13854:
URL: https://github.com/apache/arrow/pull/13854#discussion_r944520275
##########
r/tests/testthat/test-dplyr-funcs-datetime.R:
##########
@@ -166,15 +255,15 @@ test_that("strptime", {
"%S", "%q", "%M", "%U", "%w", "%W", "%y", "%Y", "%R", "%T"
)
formats2 <- c(
- "a", "A", "b", "B", "d", "H", "j", "m", "Om", "T", "OS", "Ip",
+ "a", "A", "b", "B", "d", "H", "j", "m", "T", "OS", "Ip",
"S", "q", "M", "U", "w", "W", "y", "Y", "r", "R", "Tz"
)
base_format <- "%Y-%m-%d"
base_format2 <- "ymd"
# Some formats are not supported on Windows
if (!tolower(Sys.info()[["sysname"]]) == "windows") {
- formats <- c(formats, "%a", "%A", "%b", "%B", "%Om", "%OS", "%I%p", "%r",
"%T%z")
+ formats <- c(formats, "%a", "%A", "%b", "%B", "%OS", "%I%p", "%r", "%T%z")
}
for (fmt in formats) {
Review Comment:
How would one do that?
One approach would be to give result column name of the format string (but
I'm not able to make it work):
```
for (fmt in formats) {
[...]
mutate(fmt = strptime(x, format = fmt)) %>%
[...]
```
Returns:
```
actual$fmt | expected$fmt
[1] "1999-03-16 12:00:00" - NA [1]
```
But I'd like to see:
```
actual$%Y-%m-%d %H | expected$%Y-%m-%d %H
[1] "1999-03-16 12:00:00" - NA [1]
```
--
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]