Skip to content

Commit

Permalink
Fixes #91 - dplyr::ungroup() fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Jun 18, 2020
1 parent a24b547 commit 3fe86c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions R/compat-dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}


Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_grouped_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down

0 comments on commit 3fe86c4

Please sign in to comment.