Skip to content

let add_variables() error when predictors arg is missing #144

@hfrick

Description

@hfrick

It'd be helpful if add_variables() would error when the predictors argument is missing, rather than getting an error later on when, e.g., printing the workflow.

library(workflows)
library(parsnip)

wf <- workflow() %>% 
  add_variables(outcomes = mpg) %>% 
  add_model(linear_reg(), formula = mpg ~ .)
wf
#> ══ Workflow ════════════════════════════════════════════════════════════════════
#> Preprocessor: Variables
#> Model: linear_reg()
#> 
#> ── Preprocessor ────────────────────────────────────────────────────────────────
#> Error in expr_text(predictors): argument "predictors" is missing, with no default

Created on 2022-03-14 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions