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

joins and attribute handling #4617

Closed
romainfrancois opened this issue Nov 15, 2019 · 2 comments
Closed

joins and attribute handling #4617

romainfrancois opened this issue Nov 15, 2019 · 2 comments

Comments

@romainfrancois
Copy link
Member

We have this test that is currently skipped in dev.

test_that("join takes LHS with warning if attributes inconsistent", {
  skip("we need to talk about this")
  df1 <- tibble(a = 1:2, b = 2:1)
  df2 <- tibble(
    a = structure(1:2, foo = "bar"),
    c = 2:1
  )

  expect_warning(
    out1 <- left_join(df1, df2, by = "a"),
    "Column `a` has different attributes on LHS and RHS of join"
  )
  expect_warning(out2 <- left_join(df2, df1, by = "a"))
  expect_warning(
    out3 <- left_join(df1, df2, by = c("b" = "a")),
    "Column `b`/`a` has different attributes on LHS and RHS of join"
  )

  expect_equal(attr(out1$a, "foo"), NULL)
  expect_equal(attr(out2$a, "foo"), "bar")
})

Do we still want this, or should it rather be something vctrs can deal with, and so be related to classes rather than free form attributes.

@hadley
Copy link
Member

hadley commented Dec 10, 2019

I think you can delete the test and file an issue on vctrs to make sure we think about free form attributes on data frames.

@hadley
Copy link
Member

hadley commented Dec 10, 2019

Done, since I'm in an issue closing frenzy 🤪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants