Skip to content

Commit

Permalink
Pass the check status to the main teal_data function call (#1070)
Browse files Browse the repository at this point in the history
Part of #1069 

Please make sure that you also use the `teal.data` branch
`1069-fix-code-warnings-when-data-is-verified@main` for testing the
example from the issue.

---------

Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
vedhav and dependabot-preview[bot] authored Jan 25, 2024
1 parent b1bbe12 commit ba14515
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Collate:
'dummy_functions.R'
'get_rcode_utils.R'
Expand Down
8 changes: 7 additions & 1 deletion R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#' @param is_module_specific (`logical(1)`)\cr
#' flag determining if the filter panel is global or module-specific.
#' When set to `TRUE`, a filter panel is called inside of each module tab.
#'
#' @return depending on class of `modules`, `ui_nested_tabs` returns:
#' - `teal_module`: instantiated UI of the module
#' - `teal_modules`: `tabsetPanel` with each tab corresponding to recursively
Expand Down Expand Up @@ -267,6 +268,7 @@ srv_nested_tabs.teal_module <- function(id, datasets, modules, is_module_specifi
#'
#' @param module (`teal_module`) module where needed filters are taken from
#' @param datasets (`FilteredData`) object where needed data are taken from
#'
#' @return A `teal_data` object.
#'
#' @keywords internal
Expand All @@ -291,10 +293,14 @@ srv_nested_tabs.teal_module <- function(id, datasets, modules, is_module_specifi
get_datasets_code(datanames, datasets, hashes)
)

do.call(

data <- do.call(
teal.data::teal_data,
args = c(data, code = list(code), join_keys = list(datasets$get_join_keys()[datanames]))
)

data@verified <- attr(datasets, "verification_status")
return(data)
}

#' Get the hash of a dataset
Expand Down
1 change: 1 addition & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ teal_data_to_filtered_data <- function(x, datanames = teal_data_datanames(x)) {
)
# Piggy-back entire pre-processing code so that filtering code can be appended later.
attr(ans, "preprocessing_code") <- teal.code::get_code(x)
attr(ans, "verification_status") <- x@verified
ans
}

Expand Down

0 comments on commit ba14515

Please sign in to comment.