From ebd30f9cdb393f155c000570cccfdbd88c740935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 16 Jul 2023 20:52:33 +0200 Subject: [PATCH] Don't overwrite dplyr_reconstruct() --- NAMESPACE | 1 - R/dplyr_reconstruct.R | 10 ---------- tests/testthat/test-dplyr.R | 2 -- 3 files changed, 13 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 5c328921..055f59f0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/dplyr_reconstruct.R b/R/dplyr_reconstruct.R index 44c8ddb7..6b3e1b9a 100644 --- a/R/dplyr_reconstruct.R +++ b/R/dplyr_reconstruct.R @@ -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"))) { diff --git a/tests/testthat/test-dplyr.R b/tests/testthat/test-dplyr.R index 476d1372..b9992535 100644 --- a/tests/testthat/test-dplyr.R +++ b/tests/testthat/test-dplyr.R @@ -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)