Skip to content

Commit

Permalink
Don't overwrite dplyr_reconstruct()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 16, 2023
1 parent 42c7d6b commit ebd30f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ S3method(count,duckplyr_df)
S3method(cross_join,duckplyr_df)
S3method(distinct,duckplyr_df)
S3method(do,duckplyr_df)
S3method(dplyr_reconstruct,data.frame)
S3method(dplyr_reconstruct,duckplyr_df)
S3method(explain,duckplyr_df)
S3method(filter,duckplyr_df)
Expand Down
10 changes: 0 additions & 10 deletions R/dplyr_reconstruct.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
#' @importFrom dplyr dplyr_reconstruct
NULL

#' @export
dplyr_reconstruct.data.frame <- function(data, template) {
attrs <- attributes(template)
attrs$names <- names(data)
attrs$row.names <- .row_names_info(data, type = 0L)

attributes(data) <- attrs
data
}

#' @export
dplyr_reconstruct.duckplyr_df <- function(data, template) {
if (inherits(data, c("grouped_df", "rowwise_df"))) {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ test_that("no homonyms", {
names_duckplyr <- ls(duckplyr)

names_common <- intersect(names_dplyr, names_duckplyr)
# Allow overwriting
names_common <- setdiff(names_common, c("dplyr_reconstruct", "dplyr_reconstruct.data.frame"))
names_common

objs_dplyr <- mget(names_common, dplyr)
Expand Down

0 comments on commit ebd30f9

Please sign in to comment.