Skip to content

Dead exported function: finalize_workflow_preprocessor() #1157

@hfrick

Description

@hfrick

Summary

finalize_workflow_preprocessor() is exported (via @rdname tune-internal-functions) but has zero callers in R/, tests/, or inst/.

Location

tune/R/grid_helpers.R

Lines 115 to 129 in 3544816

#' @export
#' @rdname tune-internal-functions
finalize_workflow_preprocessor <- function(workflow, grid_preprocessor) {
# Already finalized, nothing to tune
if (ncol(grid_preprocessor) == 0L) {
return(workflow)
}
recipe <- extract_preprocessor(workflow)
recipe <- merge(recipe, grid_preprocessor)$x[[1]]
workflow <- set_workflow_recipe(workflow, recipe)
workflow
}

What it does

Finalizes a workflow's recipe preprocessor by merging tuning parameter values from a grid into the recipe. If the grid has no columns, it returns the workflow unchanged.

Why it's dead

The current loop architecture uses finalize_fit_pre() (in R/loop_over_all_stages-helpers.R) instead, which handles preprocessor finalization as part of the broader fit pipeline.

Suggested fix

Check whether any downstream packages (e.g., finetune, workflowsets) call this function. If not, deprecate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upkeepmaintenance, infrastructure, and similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions