diff --git a/R/data_extract_module.R b/R/data_extract_module.R index 09285786..1ff4e149 100644 --- a/R/data_extract_module.R +++ b/R/data_extract_module.R @@ -457,7 +457,7 @@ data_extract_srv.list <- function(id, datasets, data_extract_spec, join_keys = N # get keys out of join_keys if (!is.null(join_keys)) { - keys <- sapply(names(datasets), simplify = FALSE, function(x) join_keys[x, x]) + keys <- sapply(names(datasets), simplify = FALSE, function(x) join_keys[[x]][[x]]) } else { keys <- sapply(names(datasets), simplify = FALSE, function(x) character(0)) } diff --git a/R/get_merge_call.R b/R/get_merge_call.R index 1b22ed1d..4541b369 100644 --- a/R/get_merge_call.R +++ b/R/get_merge_call.R @@ -130,7 +130,7 @@ get_merge_key_grid <- function(selector_list, join_keys = teal.data::join_keys() get_merge_key_pair( selector_from, selector_to, - join_keys[selector_from$dataname, selector_to$dataname] + join_keys[[selector_from$dataname]][[selector_to$dataname]] ) } ) diff --git a/R/merge_datasets.R b/R/merge_datasets.R index 3ff60973..87fd3b76 100644 --- a/R/merge_datasets.R +++ b/R/merge_datasets.R @@ -278,7 +278,7 @@ are_needed_keys_provided <- function(join_keys, merged_selector_list) { } do_join_keys_exist <- function(dataset_name1, dataset_name2, join_keys) { - length(join_keys[dataset_name1, dataset_name2] > 0) + length(join_keys[[dataset_name1]][[dataset_name2]] > 0) } datasets_names <- vapply(merged_selector_list, function(slice) slice[["dataname"]], FUN.VALUE = character(1)) diff --git a/tests/testthat/test-merge_expression_srv.R b/tests/testthat/test-merge_expression_srv.R index 13212421..bc6b43f8 100644 --- a/tests/testthat/test-merge_expression_srv.R +++ b/tests/testthat/test-merge_expression_srv.R @@ -20,7 +20,7 @@ adsl_data_extract_srv_output <- dataname = "ADSL", filters = NULL, select = "AGE", - keys = join_keys["ADSL", "ADSL"], + keys = join_keys[["ADSL", "ADSL"]], reshape = FALSE, internal_id = "adsl_extract" ) @@ -30,7 +30,7 @@ adlb_data_extract_srv_output <- dataname = "ADLB", filters = NULL, select = c("AVAL", "CHG"), - keys = join_keys["ADLB", "ADLB"], + keys = join_keys[["ADLB", "ADLB"]], reshape = FALSE, internal_id = "adlb_extract" )