Skip to content

Commit

Permalink
Merge pull request #535 from yjunechoe/val_comparison-regression
Browse files Browse the repository at this point in the history
Bugfix regression in `value = vars("col")` behavior
  • Loading branch information
rich-iannone committed May 9, 2024
2 parents 4d967d2 + e90a836 commit 374e9f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 415 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,5 +1,7 @@
# pointblank (development version)

- Fixed a regression in `col_vals_*()` functions, where `vars("col")` was evaluating to the string `"col"`. Behavior of `vars("col")` is now aligned back with `vars(col)` - both evaluate to the column name `col`.

# pointblank 0.12.1

- Ensured that the column string is a symbol before constructing the expression for the `col_vals_*()` functions.
Expand Down
5 changes: 3 additions & 2 deletions R/interrogate.R
Expand Up @@ -1084,8 +1084,9 @@ interrogate_comparison <- function(
value <- get_values_at_idx(agent = agent, idx = idx)

# Normalize a column in `vars()` to a `name` object
if (inherits(value, "list")) {
value <- value[1][[1]] %>% rlang::get_expr()
if (inherits(value, "list") && rlang::is_quosure(value[1][[1]])) {
# Both `vars(col)` and `vars("col")` become `col` for `dplyr::mutate()`
value <- rlang::sym(rlang::quo_get_expr(value[1][[1]]))
}

# Obtain the target column as a label
Expand Down

0 comments on commit 374e9f8

Please sign in to comment.