Copilot commented on code in PR #50178:
URL: https://github.com/apache/arrow/pull/50178#discussion_r3414226566
##########
r/tests/testthat/test-metadata.R:
##########
@@ -517,3 +517,12 @@ test_that("apply_arrow_r_metadata doesn't add in metadata
from plain data.frame
expect_null(attr(spicy_df_no_metadata$num, "format.spss"))
expect_equal(attr(spicy_df_with_metadata$num, "format.spss"), "F8.2")
})
+
+test_that("metadata keys starting with 'r' don't cause partial matching -
GH-50163", {
+ tbl <- arrow_table(x = 1:3)
+ tbl <- tbl$cast(tbl$schema$WithMetadata(list(rachel = "some_value")))
+
+ expect_no_warning(as.data.frame(tbl))
+ expect_no_warning(collect(tbl))
+ expect_no_error(expect_equal(group_vars(tbl), character(0)))
Review Comment:
`expect_no_error(expect_equal(...))` is redundant here and can make the test
output harder to interpret. `expect_equal()` already fails the test if
`group_vars(tbl)` errors or returns the wrong value, so you can assert the
result directly.
--
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]