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


##########
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:
   I agree with your point, but we also discourage testing of error messages 
which come from libarrow. I guess I can add some custom error handling that we 
can test for.



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