From 1b024376f76e94c34bf7c8e7405cce8773a3f3a5 Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Thu, 8 Aug 2024 12:07:18 +0200 Subject: [PATCH] fix get_filter_expr --- R/FilteredData-utils.R | 2 +- R/filter_panel_api.R | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/R/FilteredData-utils.R b/R/FilteredData-utils.R index b44f5232b..6f2e272a3 100644 --- a/R/FilteredData-utils.R +++ b/R/FilteredData-utils.R @@ -51,7 +51,7 @@ eval_expr_with_msg <- function(expr, env) { error = function(e) { stop( sprintf( - "Call execution failed:\n - call:\n %s\n - message:\n %s ", + "Filter call execution failed:\n - call:\n %s\n - message:\n %s ", deparse1(x, collapse = "\n"), e ) ) diff --git a/R/filter_panel_api.R b/R/filter_panel_api.R index 861e08aef..a76f893db 100644 --- a/R/filter_panel_api.R +++ b/R/filter_panel_api.R @@ -167,12 +167,9 @@ clear_filter_states <- function(datasets, force = FALSE) { #' @export #' get_filter_expr <- function(datasets, datanames = datasets$datanames()) { - checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE) - stopifnot( - is(datasets, "FilteredData"), - all(datanames %in% datasets$datanames()) - ) - + checkmate::check_class(datasets, "FilteredData") + checkmate::assert_character(datanames, any.missing = FALSE) + checkmate::assert_subset(datanames, datasets$datanames()) paste( unlist(lapply( datanames,