From 7bf52c11c8f480c3f933ca62dc4c00ea96e5db54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 17 Oct 2024 06:48:08 +0200 Subject: [PATCH] chore: Sync patches --- patch/anti_join.patch | 4 ++-- patch/count.patch | 22 ++++++++++------------ patch/full_join.patch | 4 ++-- patch/inner_join.patch | 4 ++-- patch/left_join.patch | 4 ++-- patch/right_join.patch | 4 ++-- patch/semi_join.patch | 4 ++-- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/patch/anti_join.patch b/patch/anti_join.patch index f88cb7c0..13dac403 100644 --- a/patch/anti_join.patch +++ b/patch/anti_join.patch @@ -1,5 +1,5 @@ diff --git b/R/anti_join.R a/R/anti_join.R -index 02a430b5..5801b310 100644 +index 02a430b5..dfb51d99 100644 --- b/R/anti_join.R +++ a/R/anti_join.R @@ -1,17 +1,24 @@ @@ -16,7 +16,7 @@ index 02a430b5..5801b310 100644 # Our implementation - rel_try( - "No relational implementation for anti_join()" = TRUE, -+ rel_try(call = list(name = "anti_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, na_matches = na_matches)), ++ rel_try(call = list(name = "anti_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, na_matches = na_matches)), { + out <- rel_join_impl(x, y, by, "anti", na_matches, error_call = error_call) return(out) diff --git a/patch/count.patch b/patch/count.patch index 9538ac0e..a2e6960d 100644 --- a/patch/count.patch +++ b/patch/count.patch @@ -1,8 +1,8 @@ diff --git b/R/count.R a/R/count.R -index 0b855695..ab4d26a0 100644 +index 0b855695..8e76fc03 100644 --- b/R/count.R +++ a/R/count.R -@@ -1,14 +1,51 @@ +@@ -1,14 +1,49 @@ # Generated by 02-duckplyr_df-methods.R #' @export count.duckplyr_df <- function(x, ..., wt = NULL, sort = FALSE, name = NULL, .drop = group_by_drop_default(x)) { @@ -19,20 +19,18 @@ index 0b855695..ab4d26a0 100644 + by_exprs <- unname(map(by, quo_get_expr)) + is_name <- map_lgl(by_exprs, is_symbol) + -+ rel_try(call = list(name = "count", x = x, args = list(dots = enquos(...), wt = enquo(wt), sort = sort, name = if (!is.null(name)) sym(name), .drop = .drop)), ++ by_chr <- map_chr(by_exprs, as_string) ++ name_was_null <- is.null(name) ++ name <- check_n_name(name, by_chr, call = dplyr_error_call()) ++ ++ n <- tally_n(x, {{ wt }}) ++ ++ rel_try(call = list(name = "count", x = x, args = list(dots = enquos(...), wt = enquo(wt), sort = sort, name = if (!name_was_null) sym(name), .drop = .drop)), + "count() needs all(is_name)" = !all(is_name), + "count() only implemented for .drop = TRUE" = !.drop, + "count() only implemented for sort = FALSE" = sort, ++ "Name clash in count()" = (name %in% by_chr), { -+ by_chr <- map_chr(by_exprs, as_string) -+ name <- check_n_name(name, by_chr) -+ -+ if (name %in% by_chr) { -+ cli::cli_abort("Name clash in `count()`") -+ } -+ -+ n <- tally_n(x, {{ wt }}) -+ + rel <- duckdb_rel_from_df(x) + + groups <- rel_translate_dots(by, x) diff --git a/patch/full_join.patch b/patch/full_join.patch index 08a280fd..568b6722 100644 --- a/patch/full_join.patch +++ b/patch/full_join.patch @@ -1,5 +1,5 @@ diff --git b/R/full_join.R a/R/full_join.R -index ef65f78a..63b3fdaf 100644 +index ef65f78a..afd19875 100644 --- b/R/full_join.R +++ a/R/full_join.R @@ -1,17 +1,22 @@ @@ -13,7 +13,7 @@ index ef65f78a..63b3fdaf 100644 # Our implementation - rel_try( - "No relational implementation for full_join()" = TRUE, -+ rel_try(call = list(name = "full_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, relationship = relationship)), ++ rel_try(call = list(name = "full_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, relationship = relationship)), + "No implicit cross joins for full_join()" = is_cross_by(by), { + out <- rel_join_impl(x, y, by, "full", na_matches, suffix, keep, error_call) diff --git a/patch/inner_join.patch b/patch/inner_join.patch index 55e438d3..468f920e 100644 --- a/patch/inner_join.patch +++ b/patch/inner_join.patch @@ -1,5 +1,5 @@ diff --git b/R/inner_join.R a/R/inner_join.R -index 9c26eacb..48e82a1d 100644 +index 9c26eacb..000e6e0d 100644 --- b/R/inner_join.R +++ a/R/inner_join.R @@ -1,17 +1,22 @@ @@ -13,7 +13,7 @@ index 9c26eacb..48e82a1d 100644 # Our implementation - rel_try( - "No relational implementation for inner_join()" = TRUE, -+ rel_try(call = list(name = "inner_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), ++ rel_try(call = list(name = "inner_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), + "No implicit cross joins for inner_join()" = is_cross_by(by), { + out <- rel_join_impl(x, y, by, "inner", na_matches, suffix, keep, error_call) diff --git a/patch/left_join.patch b/patch/left_join.patch index 26a1237a..bb292b7d 100644 --- a/patch/left_join.patch +++ b/patch/left_join.patch @@ -1,5 +1,5 @@ diff --git b/R/left_join.R a/R/left_join.R -index d5e954be..aec81a64 100644 +index d5e954be..c527d647 100644 --- b/R/left_join.R +++ a/R/left_join.R @@ -1,17 +1,22 @@ @@ -13,7 +13,7 @@ index d5e954be..aec81a64 100644 # Our implementation - rel_try( - "No relational implementation for left_join()" = TRUE, -+ rel_try(call = list(name = "left_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), ++ rel_try(call = list(name = "left_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), + "No implicit cross joins for left_join()" = is_cross_by(by), { + out <- rel_join_impl(x, y, by, "left", na_matches, suffix, keep, error_call) diff --git a/patch/right_join.patch b/patch/right_join.patch index 77fc77a6..67e63d51 100644 --- a/patch/right_join.patch +++ b/patch/right_join.patch @@ -1,5 +1,5 @@ diff --git b/R/right_join.R a/R/right_join.R -index b3c5399e..49380684 100644 +index b3c5399e..01cf7594 100644 --- b/R/right_join.R +++ a/R/right_join.R @@ -1,17 +1,22 @@ @@ -13,7 +13,7 @@ index b3c5399e..49380684 100644 # Our implementation - rel_try( - "No relational implementation for right_join()" = TRUE, -+ rel_try(call = list(name = "right_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), ++ rel_try(call = list(name = "right_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)), + "No implicit cross joins for right_join()" = is_cross_by(by), { + out <- rel_join_impl(x, y, by, "right", na_matches, suffix, keep, error_call) diff --git a/patch/semi_join.patch b/patch/semi_join.patch index cf00b6c6..8cde11f4 100644 --- a/patch/semi_join.patch +++ b/patch/semi_join.patch @@ -1,5 +1,5 @@ diff --git b/R/semi_join.R a/R/semi_join.R -index e8259a70..2dccf2a4 100644 +index e8259a70..843447ec 100644 --- b/R/semi_join.R +++ a/R/semi_join.R @@ -1,17 +1,24 @@ @@ -16,7 +16,7 @@ index e8259a70..2dccf2a4 100644 # Our implementation - rel_try( - "No relational implementation for semi_join()" = TRUE, -+ rel_try(call = list(name = "semi_join", x = x, y = y, args = list(by = if(!is.null(by)) as_join_by(by), copy = copy, na_matches = na_matches)), ++ rel_try(call = list(name = "semi_join", x = x, y = y, args = list(by = if(!is.null(by) && !is_cross_by(by)) as_join_by(by), copy = copy, na_matches = na_matches)), { + out <- rel_join_impl(x, y, by, "semi", na_matches, error_call = error_call) return(out)