Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ prompt_missing_implementation <- function(spec,
msg <- c(
"!" = "{.pkg parsnip} could not locate an implementation for `{cls}` {mode} \\
model specifications{if (isTRUE(user_specified_engine)) {
' using the `{engine}` engine' } else {''}}."
paste0(' using the `', engine, '` engine')} else {''}}."
)

if (nrow(avail) == 0 && nrow(all) > 0) {
Expand Down
7 changes: 7 additions & 0 deletions tests/testthat/_snaps/fit_interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@
i Please install (if needed) and load to continue.


---

! parsnip could not locate an implementation for `cubist_rules` model specifications using the `Cubist` engine.
i The parsnip extension package rules implements support for this specification.
i Please install (if needed) and load to continue.


1 change: 1 addition & 0 deletions tests/testthat/test_fit_interfaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ test_that('No loaded engines', {
)
expect_snapshot_error({cubist_rules() %>% fit(mpg ~., data = mtcars)})
expect_snapshot_error({poisson_reg() %>% fit(mpg ~., data = mtcars)})
expect_snapshot_error({cubist_rules(engine = "Cubist") %>% fit(mpg ~., data = mtcars)})
})