You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 08:55:34 UTC

[GitHub] [arrow] dragosmg commented on a diff in pull request #12610: ARROW-14943: [R] Bindings for lubridate's ddays, dhours, dminutes, dmonths, dweeks, dyears

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org