Skip to content

Commit 8005e5d

Browse files
authored
chore: explain() returns the input, invisibly (#331)
1 parent 145ce56 commit 8005e5d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

R/explain.R

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@ explain.duckplyr_df <- function(x, ...) {
55
{
66
rel <- duckdb_rel_from_df(x)
77
rel_explain(rel)
8-
return(invisible())
8+
return(invisible(x))
99
}
1010
)
1111

1212
writeLines("Can't convert to relational, fallback implementation will be used.")
13-
invisible()
13+
invisible(x)
14+
}
15+
16+
duckplyr_explain <- function(.data, ...) {
17+
try_fetch(
18+
.data <- as_duckplyr_df(.data),
19+
error = function(e) {
20+
testthat::skip(conditionMessage(e))
21+
}
22+
)
23+
out <- explain(.data, ...)
24+
class(out) <- setdiff(class(out), "duckplyr_df")
25+
invisible(out)
1426
}

0 commit comments

Comments
 (0)