tidymodels / recipes

Pipeable steps for feature engineering and data preprocessing to prepare for modeling
https://recipes.tidymodels.org
Other
571 stars 113 forks source link

Improve error messaging for `step_cut()` with missing data #1359

Closed jrwinget closed 2 weeks ago

jrwinget commented 3 months ago

Fixes #1351

Updated the create_full_breaks() function to provide a more informative error message when step_cut() is applied to a column containing missing values (NA). The function now checks for missing data and warns users appropriately.

EmilHvitfeldt commented 3 months ago

Looking great! would you kindly add some snapshot tests using extract_snapshot() in https://github.com/tidymodels/recipes/blob/main/tests/testthat/test-cut.R so we can verify that they trigger correctly.

Those tests should be placed above https://github.com/tidymodels/recipes/blob/main/tests/testthat/test-cut.R#L171

jrwinget commented 3 months ago

Sure thing - thanks for the feedback!

jrwinget commented 3 months ago

I've added the snapshot tests and pushed the changes. Please take a look when you have a moment. Thanks again!!

topepo commented 2 weeks ago

Thanks for the contribution!

github-actions[bot] commented 4 days ago

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.