-
Notifications
You must be signed in to change notification settings - Fork 14
Add hooks to RunWorkflow
.
#1961
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
Conversation
Still working on unit tests @lauramaxwell but the functionality is there. |
Nice, @samussiah - took a quick look and everything in the example worked as i would expect. I'll dig in a bit more in the morning, but so far so good! let me know if you want me to look into the tests, etc. |
@@ -8,6 +8,9 @@ | |||
#' | |||
#' @param lWorkflow `list` A named list of metadata defining how the workflow should be run. | |||
#' @param lData `list` A named list of domain-level data frames. | |||
#' @param lConfig `list` A configuration object with two methods: | |||
#' - `LoadData`: A function that loads data specified in `lWorkflow$spec`. | |||
#' - `SaveData`: A function that saves data returned by the last step in `lWorkflow$steps`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be helpful to add the 4_WorkflowIO.R
example to the examples in this roxygen header, or just make a reference to the example in this param explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! added a comment about adding an example to the roxygen header, but feel free to do with that as you wish.
Fixed the in-memory example and added a configuration-based example. Unit tests are in as well. |
is.function(lConfig$SaveData) && | ||
all(c('lWorkflow', 'lConfig') %in% names(formals(lConfig$SaveData))) | ||
) { | ||
cli::cli_h3('Saving data with `lConfig$SaveData`.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zdz2101 FYI- I'm going to merge this in before the logging PR gets merged, so a few new cli::
calls will need to be changed over in that PR once this gets merged to dev
Great! the new examples are super helpful. i've noted a few new |
Overview
Adds a
LoadData
hook at the beginning ofRunWorkflow
and aSaveData
hook at the end.Test Notes/Sample Code
Simplest use case that hits
clindata
and writes to .csv, also captured ininst/examples/WorkflowIO.R
:Connected Issues