Skip to content

create helper for newdata error #912

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

Merged
merged 7 commits into from
Mar 10, 2023
Merged

create helper for newdata error #912

merged 7 commits into from
Mar 10, 2023

Conversation

simonpcouch
Copy link
Contributor

Closes #525.

Copy link
Member

@EmilHvitfeldt EmilHvitfeldt left a comment

Choose a reason for hiding this comment

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

Love it!

Is there a specific reason why you put the check in all the multi_predict.*() functions instead of in multi_predict() itself?

https://github.com/tidymodels/parsnip/blob/main/R/aaa_multi_predict.R#L20-L26

@simonpcouch
Copy link
Contributor Author

simonpcouch commented Mar 10, 2023

I did so just to mirror exactly the existing implementation. We do do this check in the predict.model_fit() method, though, via check_pred_type_dots(), so maybe we should do the same in multi_predict()? I'm up for it if you are.

@EmilHvitfeldt
Copy link
Member

I'm up!

@simonpcouch
Copy link
Contributor Author

Worth mentioning that packages that re-export the multi_predict() generic will now receive this check as well, and this is probably worth revdepchecking and dropping in NEWS. Some other packages use a (now-)redundant check:

I do think dropping this into the generic is best for cutting down on technical debt in the long run, but will require a bit more effort. @hfrick, how do you feel about this change? While we're dropping this into a helper, would you make any revisions to the wording of the error?

@simonpcouch simonpcouch requested a review from hfrick March 10, 2023 13:45
Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

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

I think the generic is a good place for this check to live in 👍 +1 also to revdeps and NEWS item

@simonpcouch
Copy link
Contributor Author

Wasn't expecting this, but:

We checked 59 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

 * We saw 0 new problems

😮🎉

@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 Mar 25, 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.

Create function for newdata alert
3 participants