Skip to content

Commit a7700f0

Browse files
Merge pull request #276 from tidymodels/rlang-type-checkers
use rlang type checkers
2 parents d52874a + f3b5443 commit a7700f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1868
-47
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Imports:
2929
magrittr,
3030
Matrix,
3131
purrr,
32-
rlang,
32+
rlang (>= 1.1.0),
3333
SnowballC,
3434
tibble,
3535
tokenizers,

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ importFrom(purrr,map_lgl)
172172
importFrom(purrr,pmap)
173173
importFrom(recipes,add_step)
174174
importFrom(recipes,bake)
175-
importFrom(recipes,check_name)
176175
importFrom(recipes,check_new_data)
177176
importFrom(recipes,check_type)
178177
importFrom(recipes,get_keep_original_cols)

R/dummy_hash.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ step_dummy_hash_new <-
157157
prep.step_dummy_hash <- function(x, training, info = NULL, ...) {
158158
col_names <- recipes_eval_select(x$terms, training, info)
159159

160+
check_bool(x$signed, arg = "signed")
161+
check_number_whole(x$num_terms, min = 0, arg = "num_terms")
162+
check_bool(x$collapse, arg = "collapse")
163+
160164
check_type(training[, col_names], types = c("string", "factor", "ordered"))
161165

162166
step_dummy_hash_new(
@@ -213,7 +217,7 @@ bake.step_dummy_hash <- function(object, new_data, ...) {
213217
)
214218

215219
tf_text <- purrr::map_dfc(tf_text, as.integer)
216-
tf_text <- check_name(tf_text, new_data, object, names(tf_text))
220+
tf_text <- recipes::check_name(tf_text, new_data, object, names(tf_text))
217221

218222
new_data <- vec_cbind(new_data, tf_text)
219223
}

0 commit comments

Comments
 (0)