ianmcook commented on a change in pull request #9999:
URL: https://github.com/apache/arrow/pull/9999#discussion_r626893022



##########
File path: r/tests/testthat/test-dplyr-mutate.R
##########
@@ -15,6 +15,25 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# developer note:
+# when adapting tests from the dplyr package, note that expect_dplyr_equal()
+# works differently from expect_equal(). the first argument is a dplyr
+# expression containing the placeholder `input`, and the second argument
+# is the R data frame to pass in as that input. So for example, adapt a test
+# from dplyr as follows:
+#
+# dplyr:
+# expect_equal(
+#   mutate(data.frame(x = 1, y = 1), z = 1, x = NULL, y = NULL),
+#   data.frame(z = 1)
+# )
+#
+# arrow:
+# expect_dplyr_equal(
+#   input %>% mutate(z = 1, x = NULL, y = NULL) %>% collect(),
+#   data.frame(x = 1, y = 1)
+# )

Review comment:
       Good idea; that would probably be a better place to put this "developer 
note" comment




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

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


Reply via email to