You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2023/04/17 14:06:57 UTC

[GitHub] [arrow] thisisnic commented on a diff in pull request #35172: GH-35035: [R] Implement names<- for Schemas

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: github-unsubscribe@arrow.apache.org

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