You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/18 09:30:35 UTC

[GitHub] [arrow] dragosmg commented on a diff in pull request #12826: ARROW-15260: [R] open_dataset - add file_name as column

dragosmg commented on code in PR #12826:
URL: https://github.com/apache/arrow/pull/12826#discussion_r923140799


##########
r/tests/testthat/test-dataset.R:
##########
@@ -1226,3 +1225,16 @@ test_that("FileSystemFactoryOptions input validation", {
     fixed = TRUE
   )
 })
+
+test_that("can add in augmented fields", {
+  ds <- open_dataset(hive_dir)
+
+  ds <- ds %>%
+    mutate(file_name = add_filename()) %>%
+    collect()
+
+  expect_named(
+    ds,
+    c("int", "dbl", "lgl", "chr", "fct", "ts", "group", "other", "file_name")
+  )
+})

Review Comment:
   LGTM, just one question. Would it make sense to add here a test looking into the contents of the `file_name` column? Something along the lines of:
   ```r
   expect_equal(unique(ds$filename), list.files(hive_dir, full.names = TRUE))
   ```
   



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