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

Add comments to separate common from backend-specific code #6594

Closed
wants to merge 5 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
3 changes: 3 additions & 0 deletions R/join.R
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ nest_join.data.frame <- function(x,
...,
na_matches = c("na", "never"),
unmatched = "drop") {

# duckplyr: Common code
check_dots_empty0(...)
check_keep(keep)
na_matches <- check_na_matches(na_matches)
Expand All @@ -499,6 +501,7 @@ nest_join.data.frame <- function(x,
check_string(name)
}

# duckplyr: Backend-specific
x_names <- tbl_vars(x)
y_names <- tbl_vars(y)

Expand Down
4 changes: 3 additions & 1 deletion R/select.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ select.list <- function(.data, ...) {

#' @export
select.data.frame <- function(.data, ...) {
# duckplyr: Common code
error_call <- dplyr_error_call()

loc <- tidyselect::eval_select(
expr(c(...)),
data = .data,
error_call = error_call
)
loc <- ensure_group_vars(loc, .data, notify = TRUE)

# duckplyr: Backend-specific
loc <- ensure_group_vars(loc, .data, notify = TRUE)
out <- dplyr_col_select(.data, loc)
out <- set_names(out, names(loc))

Expand Down
2 changes: 2 additions & 0 deletions R/transmute.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ transmute <- function(.data, ...) {

#' @export
transmute.data.frame <- function(.data, ...) {
# duckplyr: Common code
dots <- check_transmute_args(...)
dots <- dplyr_quosures(!!!dots)

# duckplyr: Backend-specific
# We don't expose `.by` because `transmute()` is superseded
by <- compute_by(by = NULL, data = .data)

Expand Down