Skip to content

Commit

Permalink
remove .subset_teal_data in favour of [.teal_data
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Nov 6, 2024
1 parent 181f147 commit c3c3ce6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ srv_teal_module.teal_module <- function(id,
req(inherits(transformed_teal_data(), "teal_data"))
all_teal_data <- transformed_teal_data()
module_datanames <- .resolve_module_datanames(data = all_teal_data, modules = modules)
.subset_teal_data(all_teal_data, module_datanames)
all_teal_data[c(module_datanames, ".raw_data")] # verify if .raw_data is not skipped
})

srv_validate_reactive_teal_data(
Expand Down
25 changes: 0 additions & 25 deletions R/teal_data_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,3 @@ NULL
data@env <- new_env
data
}

#' @rdname teal_data_utilities
.subset_teal_data <- function(data, datanames) {
checkmate::assert_class(data, "teal_data")
checkmate::assert_class(datanames, "character")
datanames_corrected <- intersect(datanames, ls(teal.code::get_env(data)))
datanames_corrected_with_raw <- c(datanames_corrected, ".raw_data")
if (!length(datanames_corrected)) {
return(teal_data())
}

new_data <- do.call(
teal.data::teal_data,
args = c(
mget(x = datanames_corrected_with_raw, envir = teal.code::get_env(data)),
list(
code = teal.code::get_code(data, names = datanames_corrected_with_raw),
join_keys = teal.data::join_keys(data)[datanames_corrected]
)
)
)
new_data@verified <- data@verified
teal.data::datanames(new_data) <- datanames_corrected
new_data
}
3 changes: 0 additions & 3 deletions man/teal_data_utilities.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c3c3ce6

Please sign in to comment.