Skip to content

Commit

Permalink
Clean up now that dataset writing issue is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nealrichardson committed May 3, 2021
1 parent f99d80e commit eb6848f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions r/tests/testthat/test-dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -1557,18 +1557,17 @@ test_that("Dataset writing: dplyr methods", {
expect_true(dir.exists(dst_dir))
expect_identical(dir(dst_dir), sort(paste("int", c(1:10, 101:110), sep = "=")))

# select to specify schema
# select to specify schema (and rename)
dst_dir2 <- tempfile()
ds %>%
group_by(int) %>%
select(chr, dubs = dbl) %>%
write_dataset(dst_dir2, format = "feather")
new_ds <- open_dataset(dst_dir2, format = "feather")

# Renaming doesn't work, but mutating does??
expect_equivalent(
collect(new_ds) %>% arrange(int) %>% print(),
rbind(df1[c("chr", "dbl", "int")], df2[c("chr", "dbl", "int")]) %>% rename(dubs = dbl) %>% print()
collect(new_ds) %>% arrange(int),
rbind(df1[c("chr", "dbl", "int")], df2[c("chr", "dbl", "int")]) %>% rename(dubs = dbl)
)

# filter to restrict written rows
Expand Down

0 comments on commit eb6848f

Please sign in to comment.