dragosmg commented on code in PR #13070:
URL: https://github.com/apache/arrow/pull/13070#discussion_r870450357
##########
r/tests/testthat/test-dplyr-funcs-datetime.R:
##########
@@ -1490,8 +1490,10 @@ test_that("`as.Date()` and `as_date()`", {
dt_utc = ymd_hms("2010-08-03 00:50:50"),
date_var = as.Date("2022-02-25"),
difference_date = ymd_hms("2010-08-03 00:50:50", tz = "Pacific/Marquesas"),
- character_ymd_var = "2022-02-25 00:00:01",
- character_ydm_var = "2022/25/02 00:00:01",
+ character_ymd_hms_var = "2022-02-25 00:00:01",
+ character_ydm_hms_var = "2022/25/02 00:00:01",
+ character_ymd_var = "2022-02-25",
+ character_ydm_var = "2022/25/02",
integer_var = 32L,
Review Comment:
The `NA` appears due to the way the `tryFormats` are used: if the first
format in `tryFormats` is successful (for the first non-NA element of `x`), the
second one isn't tried. While with `coalesce` we continue to try until we run
out of formats.
--
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]