Skip to content

Commit 1e3393e

Browse files
committed
Convert NA to macro, duckdb/duckdb-r#156
1 parent 75bdce6 commit 1e3393e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: R/relational-duckdb.R

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ get_default_duckdb_connection <- function() {
1515
}
1616

1717
duckplyr_macros <- c(
18+
# https://github.com/duckdb/duckdb-r/pull/156
19+
"___null" = "() AS CAST(NULL AS BOOLEAN)",
20+
1821
"<" = '(x, y) AS "r_base::<"(x, y)',
1922
"<=" = '(x, y) AS "r_base::<="(x, y)',
2023
">" = '(x, y) AS "r_base::>"(x, y)',

Diff for: R/relational.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ rel_translate <- function(
118118

119119
switch(typeof(expr),
120120
character = ,
121-
logical = ,
122121
integer = ,
123122
double = relexpr_constant(expr),
123+
# https://github.com/duckdb/duckdb-r/pull/156
124+
logical = if (is.na(expr)) relexpr_function("___null", list()) else relexpr_constant(expr),
124125
#
125126
symbol = {
126127
if (as.character(expr) %in% names_forbidden) {

0 commit comments

Comments
 (0)