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:
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]