Skip to content

left_join() over empty grouped data frame produces error in dplyr 0.7.5 #3587

@javierluraschi

Description

@javierluraschi

Found out that this works in dplyr 0.7.4:

library(dplyr)
x <- data_frame(name = c("a", "b"), type = c("integer", "string"))
x %>% group_by(name) %>%
    select(name) %>%
    setdiff(select(x, name)) %>%
    left_join(x, by = "name")
# A tibble: 0 x 2
# Groups:   [?]
# ... with 2 variables: name <chr>, type <chr>

but not in dplyr 0.7.5:

Error in grouped_df_impl(out, vars$alias[groups_in_alias], group_drop(x),  : 
  no variables to group by

We found and pushed a fix for sparklyr with sparklyr/sparklyr#1510, but reporting to consider fixing upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions