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

Feature request: return error when errant column used in distinct() #2867

Closed
RickPack opened this issue Jun 14, 2017 · 2 comments · Fixed by #2955
Closed

Feature request: return error when errant column used in distinct() #2867

RickPack opened this issue Jun 14, 2017 · 2 comments · Fixed by #2955
Labels
bug an unexpected problem or unintended behavior

Comments

@RickPack
Copy link

Can dplyr error out when one identifies a variable that does not exist in the data frame?

## No error returned despite aa not appearing in the complimentary R data frame named "cars"
df <- cars %>% distinct(aa)
@hadley hadley added bug an unexpected problem or unintended behavior data frame labels Jun 22, 2017
hadley pushed a commit that referenced this issue Jul 17, 2017
* Return error when distinct is used on unknown columns (#2867).

* Change to using bad_cols() for error message, and update NEWS.md (#2867).

* Simplify logic for detecting missing columns in `distinct()`, and add a new test case.

* Update NEWS.md and fix whitespace formatting.
krlmlr added a commit to krlmlr/dplyr that referenced this issue Aug 26, 2017
krlmlr added a commit to krlmlr/dplyr that referenced this issue Aug 26, 2017
This reverts tidyverse#2867 and fixes the regressions found in the "epidata", "fold", and "metaplot" packages.
krlmlr added a commit that referenced this issue Aug 27, 2017
* Revert unintended API change

This reverts #2867 and fixes the regressions found in the "epidata", "fold", and "metaplot" packages.

* also remove test
@holgerbrandl
Copy link

Still broken in dplyr_0.7.2. Was it moved to a later release?

@foo-bar-baz-qux
Copy link
Contributor

@holgerbrandl yes, the change appears to be reverted and moved to v0.9 (probably)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants