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

Avoid reexporting deprecated APIs #6059

Closed
wants to merge 2 commits into from
Closed
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
15 changes: 1 addition & 14 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export(arrange_all)
export(arrange_at)
export(arrange_if)
export(as.tbl)
export(as_data_frame)
export(as_label)
export(as_tibble)
export(auto_copy)
Expand Down Expand Up @@ -233,8 +232,6 @@ export(cur_group)
export(cur_group_id)
export(cur_group_rows)
export(current_vars)
export(data_frame)
export(data_frame_)
export(db_analyze)
export(db_begin)
export(db_commit)
Expand Down Expand Up @@ -286,7 +283,6 @@ export(filter_all)
export(filter_at)
export(filter_if)
export(first)
export(frame_data)
export(full_join)
export(funs)
export(funs_)
Expand Down Expand Up @@ -332,7 +328,6 @@ export(lead)
export(left_join)
export(location)
export(lst)
export(lst_)
export(make_tbl)
export(matches)
export(min_rank)
Expand Down Expand Up @@ -443,7 +438,6 @@ export(tbl)
export(tbl_df)
export(tbl_nongroup_vars)
export(tbl_ptype)
export(tbl_sum)
export(tbl_vars)
export(tibble)
export(top_frac)
Expand All @@ -454,7 +448,6 @@ export(transmute_all)
export(transmute_at)
export(transmute_if)
export(tribble)
export(type_sum)
export(ungroup)
export(union)
export(union_all)
Expand All @@ -479,23 +472,17 @@ importFrom(magrittr,"%>%")
importFrom(methods,is)
importFrom(pillar,format_glimpse)
importFrom(pillar,glimpse)
importFrom(pillar,tbl_sum)
importFrom(stats,lag)
importFrom(stats,setNames)
importFrom(stats,update)
importFrom(tibble,add_row)
importFrom(tibble,as_data_frame)
importFrom(tibble,as_tibble)
importFrom(tibble,data_frame)
importFrom(tibble,data_frame_)
importFrom(tibble,frame_data)
importFrom(tibble,is_tibble)
importFrom(tibble,lst)
importFrom(tibble,lst_)
importFrom(tibble,new_tibble)
importFrom(tibble,tbl_sum)
importFrom(tibble,tibble)
importFrom(tibble,tribble)
importFrom(tibble,type_sum)
importFrom(tibble,view)
importFrom(tidyselect,all_of)
importFrom(tidyselect,any_of)
Expand Down
1 change: 1 addition & 0 deletions R/grouped-df.r
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ group_sum <- function(x) {
paste0(commas(group_vars(x)), " [", big_mark(grps), "]")
}

#' @importFrom pillar tbl_sum
#' @export
tbl_sum.grouped_df <- function(x, ...) {
c(
Expand Down
32 changes: 0 additions & 32 deletions R/reexport-tibble.r
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
# dataframe ---------------------------------------------------------------

#' @importFrom tibble data_frame
#' @export
tibble::data_frame

#' @importFrom tibble data_frame_
#' @export
tibble::data_frame_

#' @importFrom tibble as_data_frame
#' @export
tibble::as_data_frame

#' @importFrom tibble lst
#' @export
tibble::lst

#' @importFrom tibble lst_
#' @export
tibble::lst_

#' @importFrom tibble add_row
#' @export
tibble::add_row

# type_sum ----------------------------------------------------------------

#' @importFrom tibble type_sum
#' @export
tibble::type_sum

# glimpse -----------------------------------------------------------------

#' Get a glimpse of your data
Expand Down Expand Up @@ -66,10 +44,6 @@ glimpse

# frame-data --------------------------------------------------------------

#' @importFrom tibble frame_data
#' @export
tibble::frame_data

#' @importFrom tibble tribble
#' @export
tibble::tribble
Expand All @@ -84,9 +58,3 @@ tibble::as_tibble

#' @importFrom tibble view
tibble::view

# utils -------------------------------------------------------------------

#' @importFrom tibble tbl_sum
#' @export
tibble::tbl_sum
9 changes: 1 addition & 8 deletions man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions tests/testthat/test-deprec-do.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,69 +105,69 @@ test_that("empty data frames give consistent outputs", {

dat %>%
do(data.frame()) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
length() %>%
expect_equal(0)
dat %>%
do(data.frame(y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(y = "int"))
dat %>%
do(data.frame(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr"))
dat %>%
do(data.frame(., y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr", y = "int"))
dat %>%
do(y = ncol(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(y = "list"))

# Grouped data frame should have same col types as ungrouped, with addition
# of grouping variable
grp %>%
do(data.frame()) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr"))
grp %>%
do(data.frame(y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr", y = "int"))
grp %>%
do(data.frame(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr"))
grp %>%
do(data.frame(., y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr", y = "int"))
grp %>%
do(y = ncol(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr", y = "list"))

# A empty grouped dataset should have same types as grp
emt %>%
do(data.frame()) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr"))
emt %>%
do(data.frame(y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr", y = "int"))
emt %>%
do(data.frame(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr"))
emt %>%
do(data.frame(., y = integer(0))) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(x = "dbl", g = "chr", y = "int"))
emt %>%
do(y = ncol(.)) %>%
vapply(type_sum, character(1)) %>%
vapply(pillar::type_sum, character(1)) %>%
expect_equal(c(g = "chr", y = "list"))
})

Expand Down