From 4a8438fb57f4cd3ed4cfe66d3afec75f95aa32bf Mon Sep 17 00:00:00 2001 From: June Choe Date: Thu, 14 Mar 2024 13:48:11 -0400 Subject: [PATCH 1/2] ensure column string is symbol before constructing expression --- R/interrogate.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/interrogate.R b/R/interrogate.R index 83f1f08c2..9b6e29c25 100644 --- a/R/interrogate.R +++ b/R/interrogate.R @@ -1132,20 +1132,20 @@ tbl_val_comparison <- function( ) # Construct a string-based expression for the validation - expression <- paste(column, operator, value) + expression <- call(operator, as.symbol(column), value) if (is_tbl_mssql(table)) { table %>% dplyr::mutate(pb_is_good_ = dplyr::case_when( - !!rlang::parse_expr(expression) ~ 1, + !!expression ~ 1, TRUE ~ 0 )) } else { table %>% - dplyr::mutate(pb_is_good_ = !!rlang::parse_expr(expression)) %>% + dplyr::mutate(pb_is_good_ = !!expression) %>% dplyr::mutate(pb_is_good_ = dplyr::case_when( is.na(pb_is_good_) ~ na_pass, TRUE ~ pb_is_good_ From 4aeb80b6d096decac73d22cffd17da9918c2b3c0 Mon Sep 17 00:00:00 2001 From: June Choe Date: Thu, 14 Mar 2024 14:35:23 -0400 Subject: [PATCH 2/2] remove redundant wrapping of string in quotes --- R/interrogate.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/R/interrogate.R b/R/interrogate.R index 9b6e29c25..73faa2e00 100644 --- a/R/interrogate.R +++ b/R/interrogate.R @@ -1086,10 +1086,6 @@ interrogate_comparison <- function( # Normalize a column in `vars()` to a `name` object if (inherits(value, "list")) { value <- value[1][[1]] %>% rlang::get_expr() - } else { - if (is.character(value)) { - value <- paste0("'", value, "'") - } } # Obtain the target column as a label