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

Deprecate .data #295

Merged
merged 8 commits into from Aug 18, 2022
Merged

Deprecate .data #295

merged 8 commits into from Aug 18, 2022

Conversation

hadley
Copy link
Member

@hadley hadley commented Aug 16, 2022

Fixes #169

This will fail until r-lib/lifecycle#129 is finished, but you should still be able to review it, and I thought it might be useful to see a concrete example.

@hadley hadley requested a review from lionel- August 16, 2022 14:56
Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

expect_identical(select_loc(c(foo = "foo"), .data$foo), c(foo = 1L))
expect_identical(select_loc(c(foo = "foo"), .data[["foo"]]), c(foo = 1L))
expect_identical(select_loc(letters2, .data$a:.data$b), c(a = 1L, b = 2L))
expect_identical(select_loc(letters2, .data[["a"]]:.data[["b"]]), c(a = 1L, b = 2L))
})

test_that("use of .data is deprecated", {
x <- list(a = 1, b = 2, c = 3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should force verbosity so the test is reproducible within sessions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lifecycle always warns in tests.

@hadley hadley merged commit 56561aa into main Aug 18, 2022
@hadley hadley deleted the deprecate-dot-data branch August 18, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate .data in data-expressions
2 participants