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

Improved bind test causes crash #1506

Closed
hadley opened this issue Nov 3, 2015 · 2 comments
Closed

Improved bind test causes crash #1506

hadley opened this issue Nov 3, 2015 · 2 comments
Assignees
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@hadley
Copy link
Member

hadley commented Nov 3, 2015

test_that("bind_rows handles data frames with no columns (#1346)", {
  df1 <- data_frame(x = 1, y = factor("a"))
  df0 <- df1[, 0]

  expect_equal(bind_rows(df0), df0)
  expect_equal(bind_rows(df0, df0), df0)
  expect_equal(bind_rows(df0, df1), df1)
})

(should go in test-binds.R, in rows section)

@hadley hadley added the bug an unexpected problem or unintended behavior label Nov 3, 2015
@hadley hadley added this to the 0.5 milestone Nov 3, 2015
@romainfrancois
Copy link
Member

The problem was actually that equal_data_frame did not handle data frames with 0 columns. This is fixed now.

However, I cannot fold the tests in as is, e.g bind_rows(df0, df0) makes a df with 2 rows instead of 1, since df0 has 1 row.

@romainfrancois romainfrancois reopened this Nov 4, 2015
@hadley
Copy link
Member Author

hadley commented Nov 4, 2015

Oh, good point. I'll fix the test

@hadley hadley closed this as completed in 20b02fe Nov 4, 2015
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 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

No branches or pull requests

2 participants