diff --git a/NEWS.md b/NEWS.md index 9205b6c..5ab8950 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # tibbletime (development version) +* [Fix Ungroup Issue](https://github.com/business-science/tibbletime/issues/91) + # tibbletime 0.1.4 * Minor release to stay compatible with tibble 3.0.0 and the upcoming release diff --git a/R/compat-dplyr.R b/R/compat-dplyr.R index d01462a..6e4d495 100644 --- a/R/compat-dplyr.R +++ b/R/compat-dplyr.R @@ -139,8 +139,13 @@ group_by.tbl_time <- function(.data, ...) { #' ungroup.tbl_time <- function(x, ...) { #reconstruct(NextMethod(), x) - copy_.data <- new_tbl_time(x, get_index_quo(x), get_index_time_zone(x)) - reconstruct(NextMethod(), copy_.data) + # copy_.data <- new_tbl_time(x, get_index_quo(x), get_index_time_zone(x)) + # ret <- reconstruct(NextMethod(), copy_.data) + idx_quo <- get_index_quo(x) + idx_tz <- get_index_time_zone(x) + tbl <- dplyr::ungroup(tibble::as_tibble(x)) + new_tbl_time(tbl, idx_quo, idx_tz) + } diff --git a/tests/testthat/test_grouped_df.R b/tests/testthat/test_grouped_df.R index 7b97b0b..62196d1 100644 --- a/tests/testthat/test_grouped_df.R +++ b/tests/testthat/test_grouped_df.R @@ -13,6 +13,8 @@ test_time <- tibble::tibble( test_grouped_tbl_time <- as_tbl_time(test_time, date) %>% group_by(group) + + # Tests test_that("Ungroup works", {