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

turn table to tibble in recipe.formula #1415

Merged
merged 2 commits into from
Jan 22, 2025
Merged
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
8 changes: 8 additions & 0 deletions R/recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@
cli::cli_abort("{.arg data} is missing with no default.")
}

if (is.table(data)) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a warning or deprecation notice for this? I'd like to get rid of this down the road; it shouldn't be supported.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, i'm gonna add a warning and remove this in the following release with #1416

cli::cli_warn(
"Passing a table to {.fn recipe} is undocumented unsupported behavior.
This will no longer be possible in the next release of {.pkg recipes}."
)
data <- as_tibble(data)

Check warning on line 217 in R/recipe.R

View check run for this annotation

Codecov / codecov/patch

R/recipe.R#L213-L217

Added lines #L213 - L217 were not covered by tests
}

if (!is.data.frame(data) && !is.matrix(data) && !is_sparse_matrix(data)) {
cli::cli_abort(
"{.arg data} must be a data frame, matrix, or sparse matrix,
Expand Down
Loading