Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bugfix regression in value = vars("col") behavior #535

Merged
merged 5 commits into from
May 9, 2024

Conversation

yjunechoe
Copy link
Collaborator

This PR fixes a regression I introduced in #530, which broke value = vars("col"):

library(pointblank)
df <- data.frame(x = Sys.Date() + 1, y = Sys.Date())

# Works as expected - evaluates to `x > y`
test_col_vals_gt(df, x, vars(y))
#> [1] TRUE

# Fails - evaluates to `x > "y"`
test_col_vals_gt(df, x, vars("y"))
#> [1] NA

Now fixed - both evaluate to the symbol y:

devtools::load_all()
df <- data.frame(x = Sys.Date() + 1, y = Sys.Date())

test_col_vals_gt(df, x, vars(y))
#> [1] TRUE
test_col_vals_gt(df, x, vars("y"))
#> [1] TRUE

Also added a unit test for this equivalence in test-interrogate_simple.R

@rich-iannone rich-iannone self-requested a review May 9, 2024 21:08
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@rich-iannone rich-iannone merged commit 374e9f8 into rstudio:main May 9, 2024
12 of 13 checks passed
@yjunechoe yjunechoe deleted the val_comparison-regression branch May 9, 2024 23:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants