tidymodels / hardhat

Construct Modeling Packages
https://hardhat.tidymodels.org
Other
103 stars 17 forks source link

Restructure clean/process internals to use S3 dispatch #201

Closed DavisVaughan closed 2 years ago

DavisVaughan commented 2 years ago

We don't actually need to store the clean/process functions that support mold() and forge() in the blueprint. We can instead look up their current versions at runtime using S3 dispatch - this is what run_mold() and run_forge() are now intended to do. This means that we should never be calling an outdated clean/process function from forge(), and should result in less breakage.

We will still need to hot patch old blueprints if we add new arguments to them, like with bake_dependent_roles, but this PR gives us the ability to do that successfully now because we will always eventually call a clean/process function that knows how to use these new arguments in the first place. A follow up PR will update run_forge.default_recipe_blueprint() to patch the blueprint if it doesn't have a slot for bake_dependent_roles

github-actions[bot] commented 2 years 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.