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: Almost ready for CRAN #44

Merged
merged 5 commits into from
Sep 6, 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 .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
error-on: '"warning"'
error-on: '"note"'
2 changes: 1 addition & 1 deletion R/add_count.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_count.duckplyr_df <- function(x, ..., wt = NULL, sort = FALSE, name = NULL,
)

# dplyr forward
add_count <- dplyr:::add_count.data.frame
add_count <- dplyr$add_count.data.frame
out <- add_count(x, ..., wt = {{ wt }}, sort = sort, name = name, .drop = .drop)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/anti_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anti_join.duckplyr_df <- function(x, y, by = NULL, copy = FALSE, ..., na_matches
)

# dplyr forward
anti_join <- dplyr:::anti_join.data.frame
anti_join <- dplyr$anti_join.data.frame
out <- anti_join(x, y, by, copy, ..., na_matches = na_matches)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/arrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ arrange.duckplyr_df <- function(.data, ..., .by_group = FALSE, .locale = NULL) {
)

# dplyr forward
arrange <- dplyr:::arrange.data.frame
arrange <- dplyr$arrange.data.frame
out <- arrange(.data, ..., .by_group = .by_group, .locale = .locale)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ compute.duckplyr_df <- function(x, ...) {
)

# dplyr forward
compute <- dplyr:::compute.data.frame
compute <- dplyr$compute.data.frame
out <- compute(x, ...)
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 @@ -47,7 +47,7 @@ count.duckplyr_df <- function(x, ..., wt = NULL, sort = FALSE, name = NULL, .dro
# out <- count(x_df, !!!quos, wt = {{ wt }}, sort = sort, name = name, .drop = .drop)

# dplyr forward
count <- dplyr:::count.data.frame
count <- dplyr$count.data.frame
out <- count(x, ..., wt = {{ wt }}, sort = sort, name = name, .drop = .drop)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/cross_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cross_join.duckplyr_df <- function(x, y, ..., copy = FALSE, suffix = c(".x", ".y
)

# dplyr forward
cross_join <- dplyr:::cross_join.data.frame
cross_join <- dplyr$cross_join.data.frame
out <- cross_join(x, y, ..., copy = copy, suffix = suffix)
return(out)

Expand Down
4 changes: 2 additions & 2 deletions R/csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ duckdb_from_file <- function(path, table_function, options=list()) {
# FIXME: For some reason, it's important to create an alias here
con <- get_default_duckdb_connection()

out <- duckdb:::rel_from_table_function(
out <- duckdb$rel_from_table_function(
con,
table_function,
list(path),
Expand All @@ -19,7 +19,7 @@ duckdb_from_file <- function(path, table_function, options=list()) {

meta_rel_register_file(out, path, table_function, options)

duckdb:::rel_to_altrep(out)
duckdb$rel_to_altrep(out)
}

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

# dplyr forward
distinct <- dplyr:::distinct.data.frame
distinct <- dplyr$distinct.data.frame
out <- distinct(.data, ..., .keep_all = .keep_all)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/do.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ do.duckplyr_df <- function(.data, ...) {
)

# dplyr forward
do <- dplyr:::do.data.frame
do <- dplyr$do.data.frame
out <- do(.data, ...)
return(out)

Expand Down
156 changes: 79 additions & 77 deletions R/dplyr.R
Original file line number Diff line number Diff line change
@@ -1,80 +1,82 @@
as_across_fn_call <- dplyr:::as_across_fn_call
as_fun_list <- dplyr:::as_fun_list
as_join_by <- dplyr:::as_join_by
check_filter <- dplyr:::check_filter
check_keep <- dplyr:::check_keep
check_name <- dplyr:::check_name
check_n_name <- dplyr:::check_n_name
check_na_matches <- dplyr:::check_na_matches
check_string <- dplyr:::check_string
check_transmute_args <- dplyr:::check_transmute_args
compute_by <- dplyr:::compute_by
context_poke <- dplyr:::context_poke
count_regroups <- dplyr:::count_regroups
cur_column <- dplyr:::cur_column
DataMask <- dplyr:::DataMask
dplyr_error_call <- dplyr:::dplyr_error_call
dplyr_local_error_call <- dplyr:::dplyr_local_error_call
dplyr_quosures <- dplyr:::dplyr_quosures
eval_relocate <- dplyr:::eval_relocate
eval_select_by <- dplyr:::eval_select_by
expand_across <- dplyr:::expand_across
expand_if_across <- dplyr:::expand_if_across
expr_substitute <- dplyr:::expr_substitute
get_slice_size <- dplyr:::get_slice_size
group_by_drop_default <- dplyr:::group_by_drop_default
is_compatible <- dplyr:::is_compatible
is_cross_by <- dplyr:::is_cross_by
join_by_common <- dplyr:::join_by_common
join_cols <- dplyr:::join_cols
dplyr <- asNamespace("dplyr")

as_across_fn_call <- dplyr$as_across_fn_call
as_fun_list <- dplyr$as_fun_list
as_join_by <- dplyr$as_join_by
check_filter <- dplyr$check_filter
check_keep <- dplyr$check_keep
check_name <- dplyr$check_name
check_n_name <- dplyr$check_n_name
check_na_matches <- dplyr$check_na_matches
check_string <- dplyr$check_string
check_transmute_args <- dplyr$check_transmute_args
compute_by <- dplyr$compute_by
context_poke <- dplyr$context_poke
count_regroups <- dplyr$count_regroups
cur_column <- dplyr$cur_column
DataMask <- dplyr$DataMask
dplyr_error_call <- dplyr$dplyr_error_call
dplyr_local_error_call <- dplyr$dplyr_local_error_call
dplyr_quosures <- dplyr$dplyr_quosures
eval_relocate <- dplyr$eval_relocate
eval_select_by <- dplyr$eval_select_by
expand_across <- dplyr$expand_across
expand_if_across <- dplyr$expand_if_across
expr_substitute <- dplyr$expr_substitute
get_slice_size <- dplyr$get_slice_size
group_by_drop_default <- dplyr$group_by_drop_default
is_compatible <- dplyr$is_compatible
is_cross_by <- dplyr$is_cross_by
join_by_common <- dplyr$join_by_common
join_cols <- dplyr$join_cols
# Need to reimplement mutate_keep() to avoid dplyr_col_select()
# mutate_keep <- dplyr:::mutate_keep
mutate_relocate <- dplyr:::mutate_relocate
new_dplyr_quosure <- dplyr:::new_dplyr_quosure
new_join_by <- dplyr:::new_join_by
quo_eval_fns <- dplyr:::quo_eval_fns
some <- dplyr:::some
tally_n <- dplyr:::tally_n
# mutate_keep <- dplyr$mutate_keep
mutate_relocate <- dplyr$mutate_relocate
new_dplyr_quosure <- dplyr$new_dplyr_quosure
new_join_by <- dplyr$new_join_by
quo_eval_fns <- dplyr$quo_eval_fns
some <- dplyr$some
tally_n <- dplyr$tally_n

# Only for dead legacy code?
add_count_impl <- dplyr:::add_count_impl
arrange_rows <- dplyr:::arrange_rows
check_compatible <- dplyr:::check_compatible
check_frac <- dplyr:::check_frac
check_size <- dplyr:::check_size
coalesce <- dplyr:::coalesce
commas <- dplyr:::commas
compact_null <- dplyr:::compact_null
distinct_prepare <- dplyr:::distinct_prepare
dplyr_col_select <- dplyr:::dplyr_col_select
dplyr_local_slice_by_arg <- dplyr:::dplyr_local_slice_by_arg
dplyr_new_list <- dplyr:::dplyr_new_list
ensure_group_vars <- dplyr:::ensure_group_vars
env_bind_do_pronouns <- dplyr:::env_bind_do_pronouns
filter_rows <- dplyr:::filter_rows
groups <- dplyr:::groups
join_cast_common <- dplyr:::join_cast_common
join_filter <- dplyr:::join_filter
join_mutate <- dplyr:::join_mutate
join_rows <- dplyr:::join_rows
mutate_cols <- dplyr:::mutate_cols
mutate_keep <- dplyr:::mutate_keep
named_args <- dplyr:::named_args
nest_by.grouped_df <- dplyr:::nest_by.grouped_df
rows_bind <- dplyr:::rows_bind
rows_cast_y <- dplyr:::rows_cast_y
rows_check_by <- dplyr:::rows_check_by
rows_check_contains_by <- dplyr:::rows_check_contains_by
rows_check_unique <- dplyr:::rows_check_unique
rows_check_x_contains_y <- dplyr:::rows_check_x_contains_y
rows_check_y_conflict <- dplyr:::rows_check_y_conflict
rows_check_y_unmatched <- dplyr:::rows_check_y_unmatched
rows_df_in_place <- dplyr:::rows_df_in_place
rowwise_df <- dplyr:::rowwise_df
slice_rows <- dplyr:::slice_rows
summarise_build <- dplyr:::summarise_build
summarise_cols <- dplyr:::summarise_cols
summarise_deprecate_variable_size <- dplyr:::summarise_deprecate_variable_size
the <- dplyr:::the
tick_if_needed <- dplyr:::tick_if_needed
warn_join_cross_by <- dplyr:::warn_join_cross_by
add_count_impl <- dplyr$add_count_impl
arrange_rows <- dplyr$arrange_rows
check_compatible <- dplyr$check_compatible
check_frac <- dplyr$check_frac
check_size <- dplyr$check_size
coalesce <- dplyr$coalesce
commas <- dplyr$commas
compact_null <- dplyr$compact_null
distinct_prepare <- dplyr$distinct_prepare
dplyr_col_select <- dplyr$dplyr_col_select
dplyr_local_slice_by_arg <- dplyr$dplyr_local_slice_by_arg
dplyr_new_list <- dplyr$dplyr_new_list
ensure_group_vars <- dplyr$ensure_group_vars
env_bind_do_pronouns <- dplyr$env_bind_do_pronouns
filter_rows <- dplyr$filter_rows
groups <- dplyr$groups
join_cast_common <- dplyr$join_cast_common
join_filter <- dplyr$join_filter
join_mutate <- dplyr$join_mutate
join_rows <- dplyr$join_rows
mutate_cols <- dplyr$mutate_cols
mutate_keep <- dplyr$mutate_keep
named_args <- dplyr$named_args
nest_by.grouped_df <- dplyr$nest_by.grouped_df
rows_bind <- dplyr$rows_bind
rows_cast_y <- dplyr$rows_cast_y
rows_check_by <- dplyr$rows_check_by
rows_check_contains_by <- dplyr$rows_check_contains_by
rows_check_unique <- dplyr$rows_check_unique
rows_check_x_contains_y <- dplyr$rows_check_x_contains_y
rows_check_y_conflict <- dplyr$rows_check_y_conflict
rows_check_y_unmatched <- dplyr$rows_check_y_unmatched
rows_df_in_place <- dplyr$rows_df_in_place
rowwise_df <- dplyr$rowwise_df
slice_rows <- dplyr$slice_rows
summarise_build <- dplyr$summarise_build
summarise_cols <- dplyr$summarise_cols
summarise_deprecate_variable_size <- dplyr$summarise_deprecate_variable_size
the <- dplyr$the
tick_if_needed <- dplyr$tick_if_needed
warn_join_cross_by <- dplyr$warn_join_cross_by
2 changes: 1 addition & 1 deletion R/dplyr_reconstruct.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dplyr_reconstruct.duckplyr_df <- function(data, template) {
return(data)

# dplyr forward
dplyr_reconstruct <- dplyr:::dplyr_reconstruct.data.frame
dplyr_reconstruct <- dplyr$dplyr_reconstruct.data.frame
out <- dplyr_reconstruct(data, template)
return(out)

Expand Down
1 change: 1 addition & 0 deletions R/duckdb.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
duckdb <- asNamespace("duckdb")
2 changes: 1 addition & 1 deletion R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ filter.duckplyr_df <- function(.data, ..., .by = NULL, .preserve = FALSE) {
)

# dplyr forward
filter <- dplyr:::filter.data.frame
filter <- dplyr$filter.data.frame
out <- filter(.data, ..., .by = {{ .by }}, .preserve = .preserve)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/full_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ full_join.duckplyr_df <- function(x, y, by = NULL, copy = FALSE, suffix = c(".x"
)

# dplyr forward
full_join <- dplyr:::full_join.data.frame
full_join <- dplyr$full_join.data.frame
out <- full_join(x, y, by, copy, suffix, ..., keep = keep, na_matches = na_matches, multiple = multiple, relationship = relationship)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/group_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' @export
group_vars.duckplyr_df <- function(x) {
if (inherits(x, c("grouped_df", "rowwise_df"))) {
return(dplyr:::group_vars.data.frame(x))
return(dplyr$group_vars.data.frame(x))
}

# Avoid calling group_data()
Expand Down
2 changes: 1 addition & 1 deletion R/inner_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inner_join.duckplyr_df <- function(x, y, by = NULL, copy = FALSE, suffix = c(".x
)

# dplyr forward
inner_join <- dplyr:::inner_join.data.frame
inner_join <- dplyr$inner_join.data.frame
out <- inner_join(x, y, by, copy, suffix, ..., keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/intersect.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ intersect.duckplyr_df <- function(x, y, ...) {
)

# dplyr forward
intersect <- dplyr:::intersect.data.frame
intersect <- dplyr$intersect.data.frame
out <- intersect(x, y, ...)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/left_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ left_join.duckplyr_df <- function(x, y, by = NULL, copy = FALSE, suffix = c(".x"
)

# dplyr forward
left_join <- dplyr:::left_join.data.frame
left_join <- dplyr$left_join.data.frame
out <- left_join(x, y, by, copy, suffix, ..., keep = keep, na_matches = na_matches, multiple = multiple, unmatched = unmatched, relationship = relationship)
return(out)

Expand Down
4 changes: 2 additions & 2 deletions R/meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ meta_replay <- function(add_pre_code = TRUE) {
# HACK
count <- rel_cache$size()
res_name <- sym(paste0("rel", count))
res_mat_expr <- expr(duckdb:::rel_to_altrep(!!res_name))
res_mat_expr <- expr(duckdb$rel_to_altrep(!!res_name))
res_code <- map(list(res_name, res_mat_expr), constructive::deparse_call)

all_code <- c(
Expand Down Expand Up @@ -162,7 +162,7 @@ meta_rel_register_df <- function(rel, df) {

df_name <- meta_df_register(df)
# Expect experimental argument from outside
rel_expr <- expr(duckdb:::rel_from_df(con, !!df_name, experimental = experimental))
rel_expr <- expr(duckdb$rel_from_df(con, !!df_name, experimental = experimental))
meta_rel_register(rel, rel_expr)
}

Expand Down
2 changes: 1 addition & 1 deletion R/mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mutate.duckplyr_df <- function(.data, ..., .by = NULL, .keep = c("all", "used",
)

# dplyr forward
mutate <- dplyr:::mutate.data.frame
mutate <- dplyr$mutate.data.frame
out <- mutate(.data, ..., .by = {{ .by }}, .keep = .keep, .before = {{ .before }}, .after = {{ .after }})
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/nest_by.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nest_by.duckplyr_df <- function(.data, ..., .key = "data", .keep = FALSE) {
)

# dplyr forward
nest_by <- dplyr:::nest_by.data.frame
nest_by <- dplyr$nest_by.data.frame
out <- nest_by(.data, ..., .key = .key, .keep = .keep)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/nest_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nest_join.duckplyr_df <- function(x, y, by = NULL, copy = FALSE, keep = NULL, na
class(x_df) <- setdiff(class(x_df), "duckplyr_df")
y_df <- y
class(y_df) <- setdiff(class(y_df), "duckplyr_df")
nest_join <- dplyr:::nest_join.data.frame
nest_join <- dplyr$nest_join.data.frame
out <- nest_join(x_df, y_df, by, copy, keep, name, ..., na_matches = na_matches, unmatched = unmatched)
out <- dplyr_reconstruct(out, x)
return(out)
Expand Down
2 changes: 1 addition & 1 deletion R/pull.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pull.duckplyr_df <- function(.data, var = -1, name = NULL, ...) {
)

# dplyr forward
pull <- dplyr:::pull.data.frame
pull <- dplyr$pull.data.frame
out <- pull(.data, {{ var }}, {{ name }}, ...)
return(out)

Expand Down
2 changes: 1 addition & 1 deletion R/reframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ reframe.duckplyr_df <- function(.data, ..., .by = NULL) {
)

# dplyr forward
reframe <- dplyr:::reframe.data.frame
reframe <- dplyr$reframe.data.frame
out <- reframe(.data, ..., .by = {{ .by }})
return(out)

Expand Down
Loading