paleolimbot commented on code in PR #19706:
URL: https://github.com/apache/arrow/pull/19706#discussion_r1072496156


##########
r/tests/testthat/test-dplyr-query.R:
##########
@@ -759,3 +759,27 @@ test_that("Can use nested field refs", {
       filter(nested > 7)
   )
 })
+
+test_that("Use struct_field for $ on non-field-ref", {
+  compare_dplyr_binding(
+    .input %>%
+      mutate(
+        df_col = tibble(i = int, d = dbl)
+      ) %>%
+      transmute(
+        int2 = df_col$i,
+        dbl2 = df_col$d
+      ) %>%
+      collect(),
+    example_data
+  )
+})
+
+test_that("nested field ref error handling", {
+  expect_error(
+    example_data %>%
+      arrow_table() %>%
+      mutate(x = int$nested) %>%
+      compute()
+  )

Review Comment:
   It can be a minimal regex; however, I think it's important since 
`expect_error()` will swallow errors from completely invalid code (e.g., 
`expect_error(this_is_something(that_will)$never_run))` gives silence).



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to