File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,7 @@ check_params_for_na <- function(x) {
133133 # Found NA values (excluding NaN which is mathematically valid)
134134 na_positions <- which(is.na(data ) & ! is.nan(data ))
135135 n_na <- length(na_positions )
136-
137- cli :: cli_abort(c(
136+ warn_or_error(c(
138137 " {.code NA} values detected in parameter {.field {path}}" ,
139138 " x" = " Found NA at position{if (n_na > 1) 's' else ''}: {.val {na_positions}}" ,
140139 " i" = " Quarto CLI uses YAML 1.2 spec which cannot process R's {.code NA} values" ,
@@ -151,6 +150,18 @@ check_params_for_na <- function(x) {
151150}
152151
153152
153+ warn_or_error <- function (message , ... , .envir = parent.frame()) {
154+ if (is_cran_check()) {
155+ msg <- c(
156+ message ,
157+ " !" = " This warning will become an error in future versions of Quarto R package."
158+ )
159+ cli :: cli_warn(message = msg , ... , .envir = .envir )
160+ } else {
161+ cli :: cli_abort(message = message , ... , .envir = .envir )
162+ }
163+ }
164+
154165# inline knitr:::merge_list()
155166merge_list <- function (x , y ) {
156167 x [names(y )] <- y
You can’t perform that action at this time.
0 commit comments