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

chore: Remove dplyr_reconstruct() method #48

Merged
merged 13 commits into from
Dec 10, 2023
Merged
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Imports:
cli,
collections,
DBI,
dplyr (>= 1.1.3),
dplyr (>= 1.1.4),
duckdb (>= 0.9.1-1),
glue,
lifecycle,
Expand Down
2 changes: 0 additions & 2 deletions 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,duckplyr_df)
S3method(explain,duckplyr_df)
S3method(full_join,duckplyr_df)
S3method(group_vars,duckplyr_df)
Expand Down Expand Up @@ -355,4 +354,3 @@ importFrom(vctrs,vec_size)
importFrom(vctrs,vec_slice)
importFrom(vctrs,vec_split)
importFrom(vctrs,vec_unique_loc)
useDynLib(duckplyr, .registration = TRUE)
2 changes: 1 addition & 1 deletion R/arrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ arrange.duckplyr_df <- function(.data, ..., .by_group = FALSE, .locale = NULL) {
}

out <- rel_to_df(out_rel)
out <- dplyr_reconstruct_dispatch(out, .data)
out <- dplyr_reconstruct(out, .data)
return(out)
}
)
Expand Down
2 changes: 1 addition & 1 deletion R/count.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ count.duckplyr_df <- function(x, ..., wt = NULL, sort = FALSE, name = NULL, .dro
}

out <- rel_to_df(out_rel)
out <- dplyr_reconstruct_dispatch(out, x)
out <- dplyr_reconstruct(out, x)

return(out)
}
Expand Down
2 changes: 1 addition & 1 deletion R/distinct.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ distinct.duckplyr_df <- function(.data, ..., .keep_all = FALSE) {
}

out <- rel_to_df(out_rel)
out <- dplyr_reconstruct_dispatch(out, .data)
out <- dplyr_reconstruct(out, .data)
return(out)
}
)
Expand Down
2 changes: 0 additions & 2 deletions R/dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ DataMask <- dplyr$DataMask
dplyr_error_call <- dplyr$dplyr_error_call
dplyr_local_error_call <- dplyr$dplyr_local_error_call
dplyr_quosures <- dplyr$dplyr_quosures
# FIXME: Unneeded after https://github.com/tidyverse/dplyr/pull/6927?
dplyr_reconstruct_dispatch <- dplyr$dplyr_reconstruct_dispatch
eval_relocate <- dplyr$eval_relocate
eval_select_by <- dplyr$eval_select_by
expand_across <- dplyr$expand_across
Expand Down
33 changes: 0 additions & 33 deletions R/dplyr_reconstruct.R

This file was deleted.

5 changes: 4 additions & 1 deletion R/duckplyr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@
#' @importFrom vctrs vec_slice
#' @importFrom vctrs vec_split
#' @importFrom vctrs vec_unique_loc
#' @useDynLib duckplyr, .registration = TRUE
## usethis namespace: end
NULL

# Enable to use compiled code again
# @useDynLib duckplyr, .registration = TRUE
NULL

#' @importFrom dplyr %>%
#' @export
dplyr::"%>%"
Expand Down
2 changes: 1 addition & 1 deletion R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ filter.duckplyr_df <- function(.data, ..., .by = NULL, .preserve = FALSE) {
out_rel <- oo_restore(rel)

out <- rel_to_df(out_rel)
out <- dplyr_reconstruct_dispatch(out, .data)
out <- dplyr_reconstruct(out, .data)
return(out)
}
)
Expand Down
2 changes: 1 addition & 1 deletion R/head.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ head.duckplyr_df <- function(x, n = 6L, ...) {
rel <- duckdb_rel_from_df(x)
out_rel <- rel_limit(rel, n)
out <- rel_to_df(out_rel)
dplyr_reconstruct_dispatch(out, x)
dplyr_reconstruct(out, x)
}
2 changes: 1 addition & 1 deletion R/intersect.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ intersect.duckplyr_df <- function(x, y, ...) {

rel <- rel_set_intersect(x_rel, y_rel)
out <- rel_to_df(rel)
out <- dplyr_reconstruct_dispatch(out, x)
out <- dplyr_reconstruct(out, x)
}
return(out)
}
Expand Down
2 changes: 1 addition & 1 deletion R/mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mutate.duckplyr_df <- function(.data, ..., .by = NULL, .keep = c("all", "used",

out <- rel_to_df(rel)

out <- dplyr_reconstruct_dispatch(out, .data)
out <- dplyr_reconstruct(out, .data)

names_original <- names(.data)

Expand Down
1 change: 0 additions & 1 deletion R/overwrite.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ methods_overwrite <- function() {
vctrs::s3_register("dplyr::cross_join", "data.frame", cross_join.duckplyr_df)
vctrs::s3_register("dplyr::distinct", "data.frame", distinct.duckplyr_df)
vctrs::s3_register("dplyr::do", "data.frame", do.duckplyr_df)
vctrs::s3_register("dplyr::dplyr_reconstruct", "data.frame", dplyr_reconstruct.duckplyr_df)
vctrs::s3_register("dplyr::filter", "data.frame", filter.duckplyr_df)
vctrs::s3_register("dplyr::full_join", "data.frame", full_join.duckplyr_df)
vctrs::s3_register("dplyr::group_vars", "data.frame", group_vars.duckplyr_df)
Expand Down
2 changes: 1 addition & 1 deletion R/project.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ nexprs <- function(names) {
exprs_project <- function(rel, exprs, .data) {
out_rel <- rel_project(rel, exprs)
out <- rel_to_df(out_rel)
dplyr_reconstruct_dispatch(out, .data)
dplyr_reconstruct(out, .data)
}
11 changes: 0 additions & 11 deletions R/relational-altrep-wrap.R

This file was deleted.

1 change: 0 additions & 1 deletion R/restore.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ methods_restore <- function() {
vctrs::s3_register("dplyr::cross_join", "data.frame", dplyr$cross_join.data.frame)
vctrs::s3_register("dplyr::distinct", "data.frame", dplyr$distinct.data.frame)
vctrs::s3_register("dplyr::do", "data.frame", dplyr$do.data.frame)
vctrs::s3_register("dplyr::dplyr_reconstruct", "data.frame", dplyr$dplyr_reconstruct.data.frame)
vctrs::s3_register("dplyr::filter", "data.frame", dplyr$filter.data.frame)
vctrs::s3_register("dplyr::full_join", "data.frame", dplyr$full_join.data.frame)
vctrs::s3_register("dplyr::group_vars", "data.frame", dplyr$group_vars.data.frame)
Expand Down
2 changes: 1 addition & 1 deletion R/setdiff.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ setdiff.duckplyr_df <- function(x, y, ...) {

rel <- rel_set_diff(x_rel, y_rel)
out <- rel_to_df(rel)
out <- dplyr_reconstruct_dispatch(out, x)
out <- dplyr_reconstruct(out, x)
}
return(out)
}
Expand Down
2 changes: 1 addition & 1 deletion R/symdiff.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ symdiff.duckplyr_df <- function(x, y, ...) {

rel <- rel_set_symdiff(x_rel, y_rel)
out <- rel_to_df(rel)
out <- dplyr_reconstruct_dispatch(out, x)
out <- dplyr_reconstruct(out, x)
}
return(out)
}
Expand Down
2 changes: 1 addition & 1 deletion R/transmute.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ transmute.duckplyr_df <- function(.data, ...) {
rel <- duckdb_rel_from_df(.data)
out_rel <- rel_project(rel, exprs)
out <- rel_to_df(out_rel)
out <- dplyr_reconstruct_dispatch(out, .data)
out <- dplyr_reconstruct(out, .data)
return(out)
}
)
Expand Down
8 changes: 0 additions & 8 deletions dplyr-methods/dplyr_reconstruct.txt

This file was deleted.

4 changes: 2 additions & 2 deletions patch/arrange.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/arrange.R a/R/arrange.R
index 5576a435..bfd2b81 100644
index 5576a435..82a2e6f 100644
--- b/R/arrange.R
+++ a/R/arrange.R
@@ -1,10 +1,43 @@
Expand Down Expand Up @@ -44,7 +44,7 @@ index 5576a435..bfd2b81 100644
+ }
+
+ out <- rel_to_df(out_rel)
+ out <- dplyr_reconstruct_dispatch(out, .data)
+ out <- dplyr_reconstruct(out, .data)
return(out)
}
)
4 changes: 2 additions & 2 deletions patch/count.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/count.R a/R/count.R
index 0b85569..1a74334 100644
index 0b85569..ea3d310 100644
--- b/R/count.R
+++ a/R/count.R
@@ -1,14 +1,51 @@
Expand Down Expand Up @@ -44,7 +44,7 @@ index 0b85569..1a74334 100644
+ }
+
+ out <- rel_to_df(out_rel)
+ out <- dplyr_reconstruct_dispatch(out, x)
+ out <- dplyr_reconstruct(out, x)
+
return(out)
}
Expand Down
4 changes: 2 additions & 2 deletions patch/distinct.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/distinct.R a/R/distinct.R
index 8628a27..4b81901 100644
index 8628a27..0bcfd3c 100644
--- b/R/distinct.R
+++ a/R/distinct.R
@@ -1,10 +1,68 @@
Expand Down Expand Up @@ -68,7 +68,7 @@ index 8628a27..4b81901 100644
+ }
+
+ out <- rel_to_df(out_rel)
+ out <- dplyr_reconstruct_dispatch(out, .data)
+ out <- dplyr_reconstruct(out, .data)
return(out)
}
)
37 changes: 0 additions & 37 deletions patch/dplyr_reconstruct.patch

This file was deleted.

4 changes: 2 additions & 2 deletions patch/filter.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/filter.R a/R/filter.R
index 787a374..1a83d69 100644
index 787a374..19b1281 100644
--- b/R/filter.R
+++ a/R/filter.R
@@ -1,10 +1,31 @@
Expand Down Expand Up @@ -33,7 +33,7 @@ index 787a374..1a83d69 100644
+ out_rel <- oo_restore(rel)
+
+ out <- rel_to_df(out_rel)
+ out <- dplyr_reconstruct_dispatch(out, .data)
+ out <- dplyr_reconstruct(out, .data)
return(out)
}
)
4 changes: 2 additions & 2 deletions patch/intersect.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/intersect.R a/R/intersect.R
index e080cd6..87e7f92 100644
index e080cd6..d7446a7 100644
--- b/R/intersect.R
+++ a/R/intersect.R
@@ -2,9 +2,36 @@
Expand Down Expand Up @@ -35,7 +35,7 @@ index e080cd6..87e7f92 100644
+
+ rel <- rel_set_intersect(x_rel, y_rel)
+ out <- rel_to_df(rel)
+ out <- dplyr_reconstruct_dispatch(out, x)
+ out <- dplyr_reconstruct(out, x)
+ }
return(out)
}
Expand Down
2 changes: 1 addition & 1 deletion patch/mutate.patch
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ index 50437cc..b67af99 100644
+
+ out <- rel_to_df(rel)
+
+ out <- dplyr_reconstruct_dispatch(out, .data)
+ out <- dplyr_reconstruct(out, .data)
+
+ names_original <- names(.data)
+
Expand Down
4 changes: 2 additions & 2 deletions patch/setdiff.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/setdiff.R a/R/setdiff.R
index 314dcd7..cd2a470 100644
index 314dcd7..23852ec 100644
--- b/R/setdiff.R
+++ a/R/setdiff.R
@@ -2,9 +2,36 @@
Expand Down Expand Up @@ -35,7 +35,7 @@ index 314dcd7..cd2a470 100644
+
+ rel <- rel_set_diff(x_rel, y_rel)
+ out <- rel_to_df(rel)
+ out <- dplyr_reconstruct_dispatch(out, x)
+ out <- dplyr_reconstruct(out, x)
+ }
return(out)
}
Expand Down
4 changes: 2 additions & 2 deletions patch/symdiff.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/symdiff.R a/R/symdiff.R
index dbd08df..14b28dd 100644
index dbd08df..f99c084 100644
--- b/R/symdiff.R
+++ a/R/symdiff.R
@@ -2,9 +2,38 @@
Expand Down Expand Up @@ -37,7 +37,7 @@ index dbd08df..14b28dd 100644
+
+ rel <- rel_set_symdiff(x_rel, y_rel)
+ out <- rel_to_df(rel)
+ out <- dplyr_reconstruct_dispatch(out, x)
+ out <- dplyr_reconstruct(out, x)
+ }
return(out)
}
Expand Down
4 changes: 2 additions & 2 deletions patch/transmute.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git b/R/transmute.R a/R/transmute.R
index b0257fd..feb9447 100644
index b0257fd..3690230 100644
--- b/R/transmute.R
+++ a/R/transmute.R
@@ -1,10 +1,20 @@
Expand All @@ -21,7 +21,7 @@ index b0257fd..feb9447 100644
+ rel <- duckdb_rel_from_df(.data)
+ out_rel <- rel_project(rel, exprs)
+ out <- rel_to_df(out_rel)
+ out <- dplyr_reconstruct_dispatch(out, .data)
+ out <- dplyr_reconstruct(out, .data)
return(out)
}
)
3 changes: 0 additions & 3 deletions src/.gitignore

This file was deleted.

Loading
Loading