Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test grouping only before tsibble 1.1.5 #480

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/testthat/test-as_tibble-decay.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ test_that("as_tibble checks an attr to avoid decay to tibble", {
})

test_that("as_tibble ungroups if needed", {
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
skip_if(packageVersion("tsibble") > "1.1.4")
edf <- jhu_csse_daily_subset %>% group_by(geo_value)
# removes the grouped_df class
expect_identical(class(as_tibble(edf)), c("tbl_df", "tbl", "data.frame"))
Expand Down
13 changes: 12 additions & 1 deletion tests/testthat/test-methods-epi_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,18 @@ test_that("Correct metadata when subset includes some of other_keys", {
# Including both original other_keys was already tested above
})

test_that("Metadata and grouping are dropped by `as_tibble`", {
test_that("Metadata is dropped by `as_tibble`", {
grouped_converted <- toy_epi_df %>%
group_by(geo_value) %>%
as_tibble()
expect_true(
!any(c("metadata") %in% names(attributes(grouped_converted)))
)
})

test_that("Grouping are dropped by `as_tibble`", {
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
skip_if(packageVersion("tsibble") > "1.1.4")
grouped_converted <- toy_epi_df %>%
group_by(geo_value) %>%
as_tibble()
Expand Down
Loading