Skip to content

eval_tidy failures: induced by differences in dplyr::mutate and tidytable::dt_mutate #39

Closed
@xiaodaigh

Description

@xiaodaigh

I think there is a difference between how dplyr treats quoted code and how tidytable treats them.

This is a blocking issue for integrating tidytable with disk.frame, see DiskFrame/disk.frame#271

fn = function(a,b) {
  a + b
}

# dplyr seems to be able to handle this correctly
mwe_mutate = function(...) {
  quo_dotdotdot = rlang::enquos(...)
  data = data.frame(num = 1:100)
  code = rlang::quo(mutate(data, !!!quo_dotdotdot))  
  rlang::eval_tidy(code)
}

mwe_mutate(b = fn(num, num))

# tidytable seems to fail 
mwe_dt_mutate = function(...) {
  quo_dotdotdot = rlang::enquos(...)
  data = data.frame(num = 1:100)
  code = rlang::quo(dt_mutate(data, !!!quo_dotdotdot))  
  rlang::eval_tidy(code)
}

mwe_dt_mutate(b = fn(num, num)) # this gives an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions