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

Should add_count() be generic? #5837

Closed
mgirlich opened this issue Apr 7, 2021 · 0 comments
Closed

Should add_count() be generic? #5837

mgirlich opened this issue Apr 7, 2021 · 0 comments
Labels
feature a feature request or enhancement

Comments

@mgirlich
Copy link

mgirlich commented Apr 7, 2021

add_count() is not generic in contrast to count(). As add_count() uses mostly exported dplyr verbs it almost works correctly in dbplyr and dtplyr. The issue is that the resulting table is grouped.

There are basically two solutions to this:

  1. make add_count() generic or
  2. Remove the check for is.data.frame(x) in add_count():
# last lines of `add_count()`
if (is.data.frame(x)) {
    out <- dplyr_reconstruct(out, x)
}
out

Then it would only be necessary to implement dplyr_reconstruct() for tbl_lazy in dbplyr and dtplyr_step in dtplyr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants