Skip to content

Commit

Permalink
Using only first class from the object, discard NULL filters from aut…
Browse files Browse the repository at this point in the history
…ofilter
  • Loading branch information
galachad committed Dec 20, 2022
1 parent f2d21ef commit 5824d72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/source_tblist.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ rule_Date <- function(column, name, dataset_name) {
}

filter_rule <- function(column, name, dataset_name) {
rule_method <- paste0("rule_", class(column))
rule_method <- paste0("rule_", class(column)[[1]])
do.call(
rule_method,
list(
Expand All @@ -198,6 +198,7 @@ autofilter.tblist <- function(source, attach_as = c("step", "meta"), ...) {
step_rule <- source$dtconn %>%
purrr::imap(~filter_rules(.x, .y)) %>%
unlist(recursive = FALSE) %>%
purrr::discard(~is.null(.x)) %>%
purrr::map(~do.call(cohortBuilder::filter, .)) %>%
unname()

Expand Down

0 comments on commit 5824d72

Please sign in to comment.