Skip to content

Commit

Permalink
Remove check for empty dots in complete
Browse files Browse the repository at this point in the history
Fixes #390
  • Loading branch information
hadley committed Jan 7, 2018
1 parent 336144a commit 9321b94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tidyr 0.7.2.9000

* `complete(data)` now returns `data` rather than throwing an error (#390).

* `separate()` now longer checks that `...` is empty, allowing methods to make
use of it. This check was added in tidyr 0.4.0 (2016-02-02) to deprecate
previous behaviour where `...` was passed to `strsplit()`.
Expand Down
4 changes: 0 additions & 4 deletions R/complete.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#' # You can also choose to fill in missing values
#' df %>% complete(group, nesting(item_id, item_name), fill = list(value1 = 0))
complete <- function(data, ..., fill = list()) {
if (is_empty(exprs(...))) {
abort("Please supply variables to complete")
}

UseMethod("complete")
}
#' @export
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-complete.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
context("complete")

test_that("complete with no variables returns data as is", {
expect_equal(complete(mtcars), mtcars)
})

test_that("basic invocation works", {
df <- tibble(x = 1:2, y = 1:2, z = 3:4)
out <- complete(df, x, y)
Expand Down

0 comments on commit 9321b94

Please sign in to comment.