Skip to content

Commit

Permalink
chore: replace '[' with '[['
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Nov 7, 2023
1 parent b2c1781 commit 9cf56da
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/data_extract_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion R/get_merge_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
)
}
)
Expand Down
2 changes: 1 addition & 1 deletion R/merge_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-merge_expression_srv.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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"
)
Expand Down

0 comments on commit 9cf56da

Please sign in to comment.