Skip to content

bug in evaluating quosures after upgrade to v1.3.2 #495

@rubenmartinez9

Description

@rubenmartinez9

The upgrade to v1.3.2 has made the example below to stop working. The example showcases a table that is being filtered using a quosure whose environment contains an object with the values to be filtered. This behavior is supported in dplyr, and can be confirmed by commenting out the lazy_dt() %>% line. Note that that object is not present in the global environment (when it is it doesn't throw an error, but it can be dangerous).

library(data.table)
library(rlang)
library(dtplyr)
library(tidyverse)
 
f1 <- function() {
  values2 = list(b = c(1:5, 7))
  filter_quo = quo(a %in% values2$b)
  filter_quo
}
f2 <- function() {
  filter_quo2 <- f1()
  tibble(
    a = 1:10
  ) %>%
    lazy_dt() %>% # if this line is omitted, it works
    filter(!!filter_quo2)
}
f2()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions