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

switch to cli in various functions #1244

Merged
merged 10 commits into from Oct 13, 2023
Merged

switch to cli in various functions #1244

merged 10 commits into from Oct 13, 2023

Conversation

EmilHvitfeldt
Copy link
Member

@EmilHvitfeldt EmilHvitfeldt commented Oct 13, 2023

ref: #1237

This PR is a little bitter since there was a couple of use-cases that didn't neatly fit anywhere else.

A bug was found, and fixed, which was about how retraining a recipe will ignore new data, this now throws a warning as intended

library(recipes)

rec <- recipe(~., data = mtcars) %>%
  step_center(disp) %>%
  prep()

rec2 <- prep(rec, mtcars)
#> Warning in prep(rec, mtcars): ! The previous data will be used by `prep()`.
#> ℹ the data passed using `training` will be ignored.

Comment on lines +273 to +277
cli::cli_abort(
c(
"!" = "Please supply at least one variable specification.",
"i" = "See {.help [?selections](recipes::selections)} \\
for more information."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add tests for this, as it is technically deprecated. I opened an issue to properly handle that here #1243

"the data passed using `training` will be ",
"ignored."
)
if (!is.null(rec$template)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the bug that is mentioned in the PR. $training never worked.

Copy link
Contributor

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking sharp!

R/misc.R Outdated Show resolved Hide resolved
EmilHvitfeldt and others added 4 commits October 13, 2023 13:17
Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
Merge commit '26a7ed8ddcffd9fefe5956b8d97d5a94a62f2778'

#Conflicts:
#	NEWS.md
@EmilHvitfeldt EmilHvitfeldt merged commit 254bf41 into main Oct 13, 2023
9 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the cli-misc branch October 13, 2023 21:01
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants