thisisnic commented on a change in pull request #41:
URL: https://github.com/apache/arrow-cookbook/pull/41#discussion_r691919239
##########
File path: r/content/reading_and_writing_data.Rmd
##########
@@ -60,11 +60,11 @@ Given a Parquet file, it can be read back in by using
`arrow::read_parquet()`.
```{r, read_parquet}
parquet_tbl <- read_parquet("my_table.parquet")
-head(parquet_tbl)
+parquet_tbl
```
```{r, test_read_parquet, opts.label = "test"}
test_that("read_parquet works as expected", {
- expect_equivalent(dplyr::collect(parquet_tbl), tibble::tibble(group = c("A",
"B", "C"), score = c(99, 97, 99)))
+ expect_identical(as.data.frame(parquet_tbl), tibble::tibble(group = c("A",
"B", "C"), score = c(99, 97, 99)))
Review comment:
I think it's because `as.data.frame()` returns a `data.frame` object
whereas `dplyr::collect()` returns a `tibble` object, so while the objects
returned contain the same values, they are of different classes (which is
something that `expect_identical` checks for).
Updating the expected return value to be created via `data.frame()` instead
of `tibble::tibble()` would fix this.
--
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]