Skip to content

Commit

Permalink
Merge pull request #306 from tidymodels/unknown-305
Browse files Browse the repository at this point in the history
return early when possible in `check_for_unknowns()`
  • Loading branch information
hfrick authored Oct 31, 2023
2 parents a1c4583 + 2384e2c commit 3e42198
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/aaa_unknown.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ has_unknowns_val <- function(object) {

check_for_unknowns <- function(x, ..., call = caller_env()) {
check_dots_empty()
if (is.atomic(x)) {
return(invisible(TRUE))
}
if (length(x) == 1 && is_unknown(x)) {
rlang::abort("Unknowns not allowed.", call = call)
}
Expand Down

0 comments on commit 3e42198

Please sign in to comment.