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


##########
r/tests/testthat/test-schema.R:
##########
@@ -260,3 +260,22 @@ test_that("as_schema() works for StructType objects", {
   struct_type <- struct(col1 = int32())
   expect_equal(as_schema(struct_type), schema(col1 = int32()))
 })
+
+test_that("schema name assignment", {
+  schm <- schema(x = int8(), y = string(), z = double())
+  expect_identical(names(schm), c("x", "y", "z"))
+  names(schm) <- c("a", "b", "c")
+  expect_identical(names(schm), c("a", "b", "c"))
+  expect_error(names(schm) <- "f")
+  expect_error(names(schm) <- letters)
+  expect_error(names(schm) <- character(0))
+  expect_error(names(schm) <- NULL)
+  expect_error(names(schm) <- c(TRUE, FALSE))

Review Comment:
   Can you either add a regex for these or use `expect_snapshot()` to ensure 
that we aren't swallowing an unrelated error here?



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

Reply via email to