Skip to content

Commit 574a8da

Browse files
krlmlraviator-bot
authored andcommitted
SNAPSHOT
1 parent 4e38aac commit 574a8da

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

R/spec-result-roundtrip.R

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ spec_result_roundtrip <- list(
7575

7676
data_date_current = function(ctx, con) {
7777
#' (also applies to the return value of the SQL function `current_date`)
78+
# FIXME: Turn into two checks, each with a separate skip
79+
# depending on the tweak, to avoid mangling the query at run time
80+
# Same with current_time and current_timestamp
7881
test_select_with_null(
7982
.ctx = ctx, con,
8083
"current_date" ~ is_roughly_current_date
@@ -273,6 +276,7 @@ test_select <- function(
273276
# Run time
274277
.ctx,
275278
.envir = parent.frame()) {
279+
276280
values <- list2(...)
277281

278282
value_is_formula <- map_lgl(values, is.call)
@@ -290,12 +294,16 @@ test_select <- function(
290294
sql_values <- names(values)
291295
}
292296

293-
if (isTRUE(.ctx$tweaks$current_needs_parens)) {
294-
sql_values <- gsub(
295-
"^(current_(?:date|time|timestamp))$", "\\1()",
296-
sql_values
297-
)
298-
}
297+
sql_values_expr <- expr({
298+
sql_values <- !!construct_expr(sql_values)
299+
300+
if (isTRUE(.ctx$tweaks$current_needs_parens)) {
301+
sql_values <- gsub(
302+
"^(current_(?:date|time|timestamp))$", "\\1()",
303+
sql_values
304+
)
305+
}
306+
})
299307

300308
sql_names <- letters[seq_along(sql_values)]
301309

0 commit comments

Comments
 (0)