Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

javierluraschi opened this issue May 21, 2018 · 4 comments


Copy link

Found out that this works in dplyr 0.7.4:

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.

Copy link

ejmacrae1 commented May 22, 2018


I have a similar issue; looks like it's related to yours. The below works in dplyr 0.7.4 but not in 0.7.5:

k <- data.frame(id=letters[1:5], col1=c("ha", "ha", NA, "ha", "ha"), stringsAsFactors=F)
k %>%
  group_by(id) %>%

Error is: "Error in summarise_impl(.data, dots) :
Column temp_col must be length 1 (a summary value), not 0"

While the expected output is:

   id temp_col
1  a       ha
2  b       ha
3  c     <NA>
4  d       ha
5  e       ha

romainfrancois added a commit that referenced this issue May 28, 2018
reconstruct groups metadata for set operations. closes #3587
Copy link

krlmlr commented Jun 25, 2018

Is it worth fixing this in v0.7.6?

@krlmlr krlmlr reopened this Jun 25, 2018
@krlmlr krlmlr added this to the 0.7.6 milestone Jun 25, 2018
Copy link

In my opinion, yes (unless it's desired behaviour).

@krlmlr krlmlr closed this as completed in a8dc325 Jun 30, 2018
Copy link

lock bot commented Dec 27, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue.

@lock lock bot locked and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

3 participants