Repository navigation
resolve_delayed now accepts a list - #74
denisovan31415 wants to merge 32 commits into
Conversation
| #' | ||
| #' @param x Object of class `delayed_data` to resolve. | ||
| #' @param datasets Object of class `FilteredData` to use for evaluation. | ||
| #' @param datasets A named list of `data.frame` to use for evaluation. |
There was a problem hiding this comment.
I will will change the argument name once it has been decided
Code Coverage SummaryResults for commit: 164d2d3 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
|
resolve_delayed occurs in teal. Please make necessary changes. After it's done please fix data_extract for accept list of data (currently it still depends on a FilteredData) |
|
The issue asked to create a new module instead of modifying the existing one. Are we settling on modifying now? |
| #' @param datasets (`list` of `reactive`) `data.frame`s | ||
| #' @param filter (`filter_spec`) the filter generated by a call to [filter_spec()] | ||
| #' @keywords internal | ||
| data_extract_filter_srv <- function(id, datasets, filter) { |
There was a problem hiding this comment.
Added validation checkmate::assert_list(datasets, types = "reactive", names = "named")
| } else if (!rlang::is_empty(input$col)) { | ||
| choices <- value_choices( | ||
| datasets$get_data(filter$dataname, filtered = TRUE), | ||
| datasets[[filter$dataname]](), |
There was a problem hiding this comment.
Without a validation this could fail with an bad error message.
There was a problem hiding this comment.
currently value_choices expects a data.frame not a reactive. We want to support only the reactive now or both of them.
There was a problem hiding this comment.
what if datasets[[filter$dataname]] is a data.frame not a reactive
There was a problem hiding this comment.
data_extract_srv --> data_extract_single_srv --> data_extract_filter_srv is the sequence actually in function. We handle whether the content of datasets is a reactive or data.frame already in data_extract_srv so we do not have to worry downstream.
| #' datasets = datasets, | ||
| #' data_extract_spec = adsl_extract | ||
| #' ) | ||
| #' # using a list of reactive `data.frame` as input to `datasets` |
There was a problem hiding this comment.
yes, in this example i give both ways to use data_extract_srv with a FilteredData object and with a list of data.frame and a list of join_keys.
There was a problem hiding this comment.
Please remove commented code or uncomment it :)
There was a problem hiding this comment.
I added 1. and 2. for both options.
| data_extract_srv <- function(id, datasets, data_extract_spec) { | ||
| checkmate::assert_class(datasets, "FilteredData") | ||
| data_extract_srv <- function(id, datasets, data_extract_spec, ...) { | ||
| checkmate::assert_multi_class(datasets, c("FilteredData", "list")) |
There was a problem hiding this comment.
nice to have additional validation here, if It is a list then should contains ...
There was a problem hiding this comment.
you could add it in data_extract_srv.list
There was a problem hiding this comment.
Check for reactive content is added in data_extract_srv.list:
checkmate::assert_list(datasets, types = "reactive", names = "named")
There was a problem hiding this comment.
data_extract_srv.list <- function(id, datasets, data_extract_spec, keys, ...) {
checkmate::assert_list(datasets, names = "named")
checkmate::assert_list(keys, names = "named")
checkmate::assert_names(names(datasets), permutation.of = names(keys))
...
| if (any(vapply(input_vals, identical, logical(1), "NA")) && | ||
| anyNA(datasets$get_data(x$dataname)[col]) && | ||
| !any(vapply(unique(datasets$get_data(x$dataname)[col]), identical, logical(1), "NA"))) { | ||
| anyNA(datasets[[x$dataname]]()[col]) && |
There was a problem hiding this comment.
are we sure datasets[[x$dataname]] is a reactive?
There was a problem hiding this comment.
Added this check in data_extract_read_srv:
checkmate::assert_list(datasets, types = "reactive", names = "named")
There was a problem hiding this comment.
I take only a quick look. I understand you will add some update here, then I will go second round. In this second round I will focus more on tests too.
It will be great to have a list what function expect a list of reactive data.frame or/and a list of data.frame.
|
Please add |
Co-authored-by: Maciej Nasinski <[email protected]>
Co-authored-by: Maciej Nasinski <[email protected]>
Done. |
|
replaced by #76 to make the branch name consistent with pharmaverse/teal#674 |


closes #67
resolve_delayed now accepts a list of data.frame or a single data.frame.
EDIT MAHMOUD:
resolvewhich is the alternative ofresolve_delayedthat accepts a list of data.frame and a list of join.keys as input. The common functions have been moved intoresolve.Rasresolve_delayed.Rwill be removed in the future.resolve_delayedis updated to useresolveinternally.resolvefunction and add a section at the end of every test file for the tests ofresolve_delayedpreceded with the title# with resolve_delayed. This would not decrease the coverage throughout the coming sprint and would facilitate the removal ofresolve_delayedand its tests in the future.resolvetests to not useFilteredDatawhere not needed.data_extract_srvforFilteredDataand list of reactive data.frames.STILL TO DO:
check_data_extract_spec_react(datasets, data_extract_spec)step that was removed.