dragosmg commented on code in PR #12610:
URL: https://github.com/apache/arrow/pull/12610#discussion_r848171286
##########
r/tests/testthat/test-dplyr-funcs-datetime.R:
##########
@@ -1228,3 +1228,37 @@ test_that("as.difftime()", {
collect()
)
})
+
+test_that("dminutes, dhours, ddays, dweeks, dmonths, dyears", {
+ example_d <- tibble(x = c(1:10, NA))
+ date_to_add <- ymd("2009-08-03", tz = "America/Chicago")
+
+ compare_dplyr_binding(
+ .input %>%
+ mutate(
+ dminutes = dminutes(x),
+ dhours = dhours(x),
+ ddays = ddays(x),
+ dweeks = dweeks(x),
+ dmonths = dmonths(x),
+ dyears = dyears(x)
+ ) %>%
+ collect(),
+ example_d,
+ ignore_attr = TRUE
+ )
+
Review Comment:
🙏🏻 Thanks for your work on this. Could you add tests where we pass R objects
to the functions? Something like:
```r
.input %>%
mutate(r_obj_minutes = dminutes(2) %>%
collect()
```
--
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]