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/06/28 15:46:15 UTC

[GitHub] [arrow] dragosmg commented on a diff in pull request #13440: ARROW-14819: [R] Binding for lubridate::qday

dragosmg commented on code in PR #13440:
URL: https://github.com/apache/arrow/pull/13440#discussion_r908643919


##########
r/tests/testthat/test-dplyr-funcs-datetime.R:
##########
@@ -719,6 +728,15 @@ test_that("extract yday from date", {
   )
 })
 
+test_that("extract qday from date", {
+  compare_dplyr_binding(
+    .input %>%
+      mutate(x = qday(date)) %>%
+      collect(),
+    test_df
+  )
+})
+

Review Comment:
   Looks great so far. Could you add a test with a regular R object? Something like:
   ```r
   compare_dplyr_binding(
   .input %>%
     mutate(y = qday(as.Date("2022-06-28")) %>%
     collect(),
   test_df
   )
   ```
   
   I think this would fail, but there's an easy solution: replace the `Expression$create()` call with a `build_expr()` one (which automatically converts an R object into a scalar).



-- 
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