Skip to content

Commit

Permalink
Convert NA to macro, duckdb/duckdb-r#156
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 5, 2024
1 parent 4a9aae3 commit a8f1d4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/relational-duckdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ get_default_duckdb_connection <- function() {
}

duckplyr_macros <- c(
# https://github.com/duckdb/duckdb-r/pull/156
"___null" = "() AS CAST(NULL AS BOOLEAN)",

"<" = '(x, y) AS "r_base::<"(x, y)',
"<=" = '(x, y) AS "r_base::<="(x, y)',
">" = '(x, y) AS "r_base::>"(x, y)',
Expand Down
3 changes: 2 additions & 1 deletion R/relational.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ rel_translate <- function(

switch(typeof(expr),
character = ,
logical = ,
integer = ,
double = relexpr_constant(expr),
# https://github.com/duckdb/duckdb-r/pull/156
logical = if (is.na(expr)) relexpr_function("___null", list()) else relexpr_constant(expr),
#
symbol = {
if (as.character(expr) %in% names_forbidden) {
Expand Down

0 comments on commit a8f1d4e

Please sign in to comment.