From e361ae8554d273646c64e3079256e34f742182d6 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 8 Nov 2024 10:03:22 -0800 Subject: [PATCH] delete duplicate test --- tests/testthat/_snaps/embed.md | 23 ++++++----------------- tests/testthat/test-embed.R | 17 ----------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/tests/testthat/_snaps/embed.md b/tests/testthat/_snaps/embed.md index 2324a20..8ea80cb 100644 --- a/tests/testthat/_snaps/embed.md +++ b/tests/testthat/_snaps/embed.md @@ -18,18 +18,17 @@ * `x3` i This may cause errors when processing new data. -# bad args +# check_name() is used Code - recipe(Species ~ ., data = three_class) %>% step_embed(Sepal.Length, outcome = vars( - Species)) %>% prep(training = three_class, retain = TRUE) + prep(rec, training = dat) Condition Error in `step_embed()`: - Caused by error in `prep()`: - x All columns selected for the step should be string, factor, or ordered. - * 1 double variable found: `Sepal.Length` + Caused by error in `bake()`: + ! Name collision occurred. The following variable names already exist: + * `x3_embed_1` ---- +# bad args Code recipe(~., data = mtcars) %>% step_embed(outcome = vars(mpg), num_terms = -4) %>% @@ -49,16 +48,6 @@ Caused by error in `prep()`: ! `hidden_units` must be a whole number larger than or equal to 0, not the number -4. -# check_name() is used - - Code - prep(rec, training = dat) - Condition - Error in `step_embed()`: - Caused by error in `bake()`: - ! Name collision occurred. The following variable names already exist: - * `x3_embed_1` - # bake method errors when needed non-standard role columns are missing Code diff --git a/tests/testthat/test-embed.R b/tests/testthat/test-embed.R index 243b482..b60cdc1 100644 --- a/tests/testthat/test-embed.R +++ b/tests/testthat/test-embed.R @@ -283,23 +283,6 @@ test_that("character encoded predictor", { ) }) -test_that("bad args", { - skip_on_cran() - skip_if_not_installed("keras") - skip_if(!embed:::is_tf_available()) - - three_class <- iris - three_class$fac <- rep(letters[1:3], 50) - three_class$logical <- rep(c(TRUE, FALSE), 75) - - expect_snapshot( - error = TRUE, - recipe(Species ~ ., data = three_class) %>% - step_embed(Sepal.Length, outcome = vars(Species)) %>% - prep(training = three_class, retain = TRUE) - ) -}) - test_that("check_name() is used", { skip_on_cran() skip_if_not_installed("keras")