Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transition warning to error when predicting from a failed model fit #1184

Open
simonpcouch opened this issue Sep 9, 2024 · 0 comments
Open
Labels
upkeep maintenance, infrastructure, and similar

Comments

@simonpcouch
Copy link
Contributor

There's a good bit of this throughout the source:

parsnip/R/predict_raw.R

Lines 18 to 21 in 8af5ddf

if (inherits(object$fit, "try-error")) {
cli::cli_warn("Model fit failed; cannot make predictions.")
return(NULL)
}

A couple thoughts:

  1. This warning likely ought to be an error.
  2. We can set parent = object$fit so that the model fit error is surfaced as part of the message.
  3. This pattern should live inside of a helper.
@simonpcouch simonpcouch added the upkeep maintenance, infrastructure, and similar label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

1 participant