Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 5, 2024
1 parent cf7296f commit 6d093e4
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion R/tpch_raw_07.R
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ tpch_raw_07 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
2 changes: 1 addition & 1 deletion R/tpch_raw_08.R
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ tpch_raw_08 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
2 changes: 1 addition & 1 deletion R/tpch_raw_09.R
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ tpch_raw_09 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
2 changes: 1 addition & 1 deletion R/tpch_raw_oo_07.R
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ tpch_raw_oo_07 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
2 changes: 1 addition & 1 deletion R/tpch_raw_oo_08.R
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ tpch_raw_oo_08 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
2 changes: 1 addition & 1 deletion R/tpch_raw_oo_09.R
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ tpch_raw_oo_09 <- function(con, experimental) {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/test-rel_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -8990,7 +8990,7 @@ test_that("relational mutate(d = row_number()) order-preserving", {
drv <- duckdb::duckdb()
con <- DBI::dbConnect(drv)
experimental <- FALSE
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
df1 <- data.frame(a = seq(1, 6, by = 1), b = rep(2, 6L), g = c(1L, 2L, 2L, 3L, 3L, 3L))

rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand All @@ -9014,7 +9014,7 @@ test_that("relational mutate(d = row_number()) order-preserving", {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_window(duckdb$expr_function("row_number", list()), list(), list(), offset_expr = NULL, default_expr = NULL)
)
Expand All @@ -9039,7 +9039,7 @@ test_that("relational mutate(d = row_number(), .by = g) order-preserving", {
drv <- duckdb::duckdb()
con <- DBI::dbConnect(drv)
experimental <- FALSE
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
df1 <- data.frame(a = seq(1, 6, by = 1), b = rep(2, 6L), g = c(1L, 2L, 2L, 3L, 3L, 3L))

rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand Down Expand Up @@ -9093,7 +9093,7 @@ test_that("relational mutate(d = row_number(), .by = g) order-preserving", {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_window(duckdb$expr_function("row_number", list()), list(duckdb$expr_reference("g")), list(), offset_expr = NULL, default_expr = NULL)
)
Expand Down Expand Up @@ -12941,7 +12941,7 @@ test_that("relational mutate(d = row_number()) order-enforcing", {
drv <- duckdb::duckdb()
con <- DBI::dbConnect(drv)
experimental <- FALSE
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
df1 <- data.frame(a = seq(1, 6, by = 1), b = rep(2, 6L), g = c(1L, 2L, 2L, 3L, 3L, 3L))

rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand All @@ -12965,7 +12965,7 @@ test_that("relational mutate(d = row_number()) order-enforcing", {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_window(duckdb$expr_function("row_number", list()), list(), list(), offset_expr = NULL, default_expr = NULL)
)
Expand Down Expand Up @@ -12994,7 +12994,7 @@ test_that("relational mutate(d = row_number(), .by = g) order-enforcing", {
drv <- duckdb::duckdb()
con <- DBI::dbConnect(drv)
experimental <- FALSE
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
df1 <- data.frame(a = seq(1, 6, by = 1), b = rep(2, 6L), g = c(1L, 2L, 2L, 3L, 3L, 3L))

rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand All @@ -13018,7 +13018,7 @@ test_that("relational mutate(d = row_number(), .by = g) order-enforcing", {
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_window(duckdb$expr_function("row_number", list()), list(duckdb$expr_reference("g")), list(), offset_expr = NULL, default_expr = NULL)
)
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw-oo/07.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y
invisible(DBI::dbExecute(con, 'CREATE MACRO ">="(x, y) AS "r_base::>="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "<="(x, y) AS "r_base::<="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "&"(x, y) AS (x AND y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
df1 <- supplier
rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
rel2 <- duckdb$rel_project(
Expand Down Expand Up @@ -1161,7 +1160,7 @@ rel70 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw-oo/08.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ invisible(DBI::dbExecute(con, 'CREATE MACRO "=="(x, y) AS "r_base::=="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO ">="(x, y) AS "r_base::>="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "<="(x, y) AS "r_base::<="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(
DBI::dbExecute(
con,
Expand Down Expand Up @@ -1168,7 +1167,7 @@ rel87 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw-oo/09.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ invisible(
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
invisible(DBI::dbExecute(con, 'CREATE MACRO "=="(x, y) AS "r_base::=="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "desc"(x) AS (-x)'))
df1 <- part
rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand Down Expand Up @@ -880,7 +879,7 @@ rel57 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw/07.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y
invisible(DBI::dbExecute(con, 'CREATE MACRO ">="(x, y) AS "r_base::>="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "<="(x, y) AS "r_base::<="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "&"(x, y) AS (x AND y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
df1 <- supplier
rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
rel2 <- duckdb$rel_project(
Expand Down Expand Up @@ -697,7 +696,7 @@ rel43 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw/08.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ invisible(DBI::dbExecute(con, 'CREATE MACRO "=="(x, y) AS "r_base::=="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO ">="(x, y) AS "r_base::>="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "<="(x, y) AS "r_base::<="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(
DBI::dbExecute(
con,
Expand Down Expand Up @@ -707,7 +706,7 @@ rel57 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down
3 changes: 1 addition & 2 deletions tools/tpch-raw/09.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ invisible(
invisible(duckdb$rapi_load_rfuns(drv@database_ref))
invisible(DBI::dbExecute(con, 'CREATE MACRO "=="(x, y) AS "r_base::=="(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "___coalesce"(x, y) AS COALESCE(x, y)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "as.integer"(x) AS CAST(x AS int32)'))
invisible(DBI::dbExecute(con, 'CREATE MACRO "desc"(x) AS (-x)'))
df1 <- part
rel1 <- duckdb$rel_from_df(con, df1, experimental = experimental)
Expand Down Expand Up @@ -569,7 +568,7 @@ rel39 <- duckdb$rel_project(
},
{
tmp_expr <- duckdb$expr_function(
"as.integer",
"r_base::as.integer",
list(
duckdb$expr_function(
"strftime",
Expand Down

0 comments on commit 6d093e4

Please sign in to comment.