Skip to content

Commit 35bb5b2

Browse files
adjst tests
1 parent dddd35f commit 35bb5b2

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

duckdb-rfuns-r/R/aggregate.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
#' @rdname aggregate
1212
#' @export
1313
rfuns_sum <- function(x, ...) {
14-
rfuns("aggregate", "sum", tibble(x = x), ...)
14+
rfuns("aggregate::sum", tibble(x = x), ...)
1515
}
1616

1717
#' @rdname aggregate
1818
#' @export
1919
rfuns_min <- function(x, ...) {
20-
rfuns("aggregate", "min", tibble(x = x), ...)
20+
rfuns("aggregate::min", tibble(x = x), ...)
2121
}
2222

2323
#' @rdname aggregate
2424
#' @export
2525
rfuns_max <- function(x, ...) {
26-
rfuns("aggregate", "max", tibble(x = x), ...)
26+
rfuns("aggregate::max", tibble(x = x), ...)
2727
}
2828

duckdb-rfuns-r/R/project.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#'
55
#' @export
66
rfuns_is.na <- function(x) {
7-
rfuns("project", "is.na", tibble(x = x))
7+
rfuns("is.na", tibble(x = x))
88
}
99

1010
#' as.integer()
@@ -13,7 +13,7 @@ rfuns_is.na <- function(x) {
1313
#'
1414
#' @export
1515
rfuns_as.integer <- function(x) {
16-
rfuns("project", "as.integer", tibble(x = x))
16+
rfuns("as.integer", tibble(x = x))
1717
}
1818

1919
#' as.numeric()
@@ -22,5 +22,5 @@ rfuns_as.integer <- function(x) {
2222
#'
2323
#' @export
2424
rfuns_as.numeric <- function(x) {
25-
rfuns("project", "as.numeric", tibble(x = x))
25+
rfuns("as.numeric", tibble(x = x))
2626
}

duckdb-rfuns-r/R/rfuns.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rfuns <- function(op = c("project", "aggregate"), fun, data, ..., error_call = caller_env()) {
1+
rfuns <- function(fun, data, ..., error_call = caller_env()) {
22
withr::local_options(list(duckdb.materialize_message = FALSE))
33
con <- local_duckdb_con()
44

@@ -13,6 +13,12 @@ rfuns <- function(op = c("project", "aggregate"), fun, data, ..., error_call = c
1313
)
1414
)
1515

16+
op <- if (grepl("aggregate::", fun)) {
17+
"aggregate"
18+
} else {
19+
"project"
20+
}
21+
1622
result <- switch(op,
1723
"project" = duckdb:::rel_project(in_rel, exprs),
1824
"aggregate" = duckdb:::rel_aggregate(in_rel, list(), exprs)

duckdb-rfuns-r/tests/testthat/_snaps/minmax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Error in `rfuns_min()`:
77
! binding error
88
Caused by error:
9-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::min(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::min(BOOLEAN, BOOLEAN) -> BOOLEAN\n\tr_base::min(BOOLEAN) -> BOOLEAN\n\tr_base::min(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::min(INTEGER) -> INTEGER\n\tr_base::min(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::min(DOUBLE) -> DOUBLE\n\tr_base::min(TIMESTAMP, BOOLEAN) -> TIMESTAMP\n\tr_base::min(TIMESTAMP) -> TIMESTAMP\n\tr_base::min(DATE, BOOLEAN) -> DATE\n\tr_base::min(DATE) -> DATE\n","name":"r_base::min","candidates":"r_base::min(BOOLEAN, BOOLEAN) -> BOOLEAN,r_base::min(BOOLEAN) -> BOOLEAN,r_base::min(INTEGER, BOOLEAN) -> INTEGER,r_base::min(INTEGER) -> INTEGER,r_base::min(DOUBLE, BOOLEAN) -> DOUBLE,r_base::min(DOUBLE) -> DOUBLE,r_base::min(TIMESTAMP, BOOLEAN) -> TIMESTAMP,r_base::min(TIMESTAMP) -> TIMESTAMP,r_base::min(DATE, BOOLEAN) -> DATE,r_base::min(DATE) -> DATE","call":"r_base::min(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
9+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::min(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::min(BOOLEAN, BOOLEAN) -> BOOLEAN\n\tr_base::aggregate::min(BOOLEAN) -> BOOLEAN\n\tr_base::aggregate::min(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::min(INTEGER) -> INTEGER\n\tr_base::aggregate::min(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::min(DOUBLE) -> DOUBLE\n\tr_base::aggregate::min(TIMESTAMP, BOOLEAN) -> TIMESTAMP\n\tr_base::aggregate::min(TIMESTAMP) -> TIMESTAMP\n\tr_base::aggregate::min(DATE, BOOLEAN) -> DATE\n\tr_base::aggregate::min(DATE) -> DATE\n","name":"r_base::aggregate::min","candidates":"r_base::aggregate::min(BOOLEAN, BOOLEAN) -> BOOLEAN,r_base::aggregate::min(BOOLEAN) -> BOOLEAN,r_base::aggregate::min(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::min(INTEGER) -> INTEGER,r_base::aggregate::min(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::min(DOUBLE) -> DOUBLE,r_base::aggregate::min(TIMESTAMP, BOOLEAN) -> TIMESTAMP,r_base::aggregate::min(TIMESTAMP) -> TIMESTAMP,r_base::aggregate::min(DATE, BOOLEAN) -> DATE,r_base::aggregate::min(DATE) -> DATE","call":"r_base::aggregate::min(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
1010

1111
---
1212

@@ -16,5 +16,5 @@
1616
Error in `rfuns_max()`:
1717
! binding error
1818
Caused by error:
19-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::max(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::max(BOOLEAN, BOOLEAN) -> BOOLEAN\n\tr_base::max(BOOLEAN) -> BOOLEAN\n\tr_base::max(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::max(INTEGER) -> INTEGER\n\tr_base::max(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::max(DOUBLE) -> DOUBLE\n\tr_base::max(TIMESTAMP, BOOLEAN) -> TIMESTAMP\n\tr_base::max(TIMESTAMP) -> TIMESTAMP\n\tr_base::max(DATE, BOOLEAN) -> DATE\n\tr_base::max(DATE) -> DATE\n","name":"r_base::max","candidates":"r_base::max(BOOLEAN, BOOLEAN) -> BOOLEAN,r_base::max(BOOLEAN) -> BOOLEAN,r_base::max(INTEGER, BOOLEAN) -> INTEGER,r_base::max(INTEGER) -> INTEGER,r_base::max(DOUBLE, BOOLEAN) -> DOUBLE,r_base::max(DOUBLE) -> DOUBLE,r_base::max(TIMESTAMP, BOOLEAN) -> TIMESTAMP,r_base::max(TIMESTAMP) -> TIMESTAMP,r_base::max(DATE, BOOLEAN) -> DATE,r_base::max(DATE) -> DATE","call":"r_base::max(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
19+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::max(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::max(BOOLEAN, BOOLEAN) -> BOOLEAN\n\tr_base::aggregate::max(BOOLEAN) -> BOOLEAN\n\tr_base::aggregate::max(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::max(INTEGER) -> INTEGER\n\tr_base::aggregate::max(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::max(DOUBLE) -> DOUBLE\n\tr_base::aggregate::max(TIMESTAMP, BOOLEAN) -> TIMESTAMP\n\tr_base::aggregate::max(TIMESTAMP) -> TIMESTAMP\n\tr_base::aggregate::max(DATE, BOOLEAN) -> DATE\n\tr_base::aggregate::max(DATE) -> DATE\n","name":"r_base::aggregate::max","candidates":"r_base::aggregate::max(BOOLEAN, BOOLEAN) -> BOOLEAN,r_base::aggregate::max(BOOLEAN) -> BOOLEAN,r_base::aggregate::max(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::max(INTEGER) -> INTEGER,r_base::aggregate::max(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::max(DOUBLE) -> DOUBLE,r_base::aggregate::max(TIMESTAMP, BOOLEAN) -> TIMESTAMP,r_base::aggregate::max(TIMESTAMP) -> TIMESTAMP,r_base::aggregate::max(DATE, BOOLEAN) -> DATE,r_base::aggregate::max(DATE) -> DATE","call":"r_base::aggregate::max(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
2020

duckdb-rfuns-r/tests/testthat/_snaps/sum.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Error in `rfuns_sum()`:
77
! binding error
88
Caused by error:
9-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(BOOLEAN, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(BOOLEAN, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
9+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(BOOLEAN, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(BOOLEAN, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
1010

1111
---
1212

@@ -16,7 +16,7 @@
1616
Error in `rfuns_sum()`:
1717
! binding error
1818
Caused by error:
19-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(INTEGER, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(INTEGER, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
19+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(INTEGER, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(INTEGER, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
2020

2121
---
2222

@@ -26,7 +26,7 @@
2626
Error in `rfuns_sum()`:
2727
! binding error
2828
Caused by error:
29-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(DOUBLE, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(DOUBLE, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
29+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(DOUBLE, VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(DOUBLE, VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
3030

3131
# r_base::sum(<VARCHAR>
3232

@@ -36,7 +36,7 @@
3636
Error in `rfuns_sum()`:
3737
! binding error
3838
Caused by error:
39-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
39+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(VARCHAR)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(VARCHAR)","error_subtype":"NO_MATCHING_FUNCTION"}
4040

4141
---
4242

@@ -46,7 +46,7 @@
4646
Error in `rfuns_sum()`:
4747
! binding error
4848
Caused by error:
49-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
49+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
5050

5151
---
5252

@@ -56,5 +56,5 @@
5656
Error in `rfuns_sum()`:
5757
! binding error
5858
Caused by error:
59-
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::sum(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::sum(BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::sum(INTEGER) -> INTEGER\n\tr_base::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::sum(DOUBLE) -> DOUBLE\n","name":"r_base::sum","candidates":"r_base::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::sum(BOOLEAN) -> INTEGER,r_base::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::sum(INTEGER) -> INTEGER,r_base::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::sum(DOUBLE) -> DOUBLE","call":"r_base::sum(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
59+
! {"exception_type":"Binder","exception_message":"No function matches the given name and argument types 'r_base::aggregate::sum(VARCHAR, BOOLEAN)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tr_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER\n\tr_base::aggregate::sum(INTEGER) -> INTEGER\n\tr_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE\n\tr_base::aggregate::sum(DOUBLE) -> DOUBLE\n","name":"r_base::aggregate::sum","candidates":"r_base::aggregate::sum(BOOLEAN, BOOLEAN) -> INTEGER,r_base::aggregate::sum(BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER, BOOLEAN) -> INTEGER,r_base::aggregate::sum(INTEGER) -> INTEGER,r_base::aggregate::sum(DOUBLE, BOOLEAN) -> DOUBLE,r_base::aggregate::sum(DOUBLE) -> DOUBLE","call":"r_base::aggregate::sum(VARCHAR, BOOLEAN)","error_subtype":"NO_MATCHING_FUNCTION"}
6060

duckdb-rfuns-r/tests/testthat/test-sum.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ test_that("r_base::sum(<BOOLEAN>)", {
22
x <- c(TRUE, TRUE, FALSE, NA)
33
empty <- logical()
44

5-
expect_equal(rfuns_sum(x, na.rm = TRUE) , sum(x, na.rm = TRUE))
6-
expect_equal(rfuns_sum(x, na.rm = FALSE), sum(x, na.rm = FALSE))
5+
expect_equal(rfuns_sum(x, na.rm = TRUE)[1] , sum(x, na.rm = TRUE))
6+
expect_equal(rfuns_sum(x, na.rm = FALSE)[1], sum(x, na.rm = FALSE))
77
expect_equal(rfuns_sum(empty, na.rm = FALSE), sum(empty, na.rm = TRUE))
88
expect_equal(rfuns_sum(empty, na.rm = TRUE) , sum(empty, na.rm = FALSE))
99

10-
expect_equal(rfuns_sum(x) , sum(x))
11-
expect_equal(rfuns_sum(x), sum(x))
10+
expect_equal(rfuns_sum(x)[1] , sum(x))
11+
expect_equal(rfuns_sum(x)[1], sum(x))
1212
expect_equal(rfuns_sum(empty), sum(empty))
1313
expect_equal(rfuns_sum(empty), sum(empty))
1414
})

0 commit comments

Comments
 (0)