-
Notifications
You must be signed in to change notification settings - Fork 4.1k
ARROW-9387: [R] Use new C++ table select method #8125
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
Changes from all commits
7dec4ed
ab4dd81
3668ad5
0686538
d60683d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,16 +130,16 @@ test_that("[, [[, $ for Table", { | |
| expect_null(tab[["asdf"]]) | ||
| # List-like column slicing | ||
| expect_data_frame(tab[2:4], tbl[2:4]) | ||
| expect_data_frame(tab[c(1, 0)], tbl[c(1, 0)]) | ||
| expect_data_frame(tab[c(2, 1)], tbl[c(2, 1)]) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we maintain the base R behavior for subsetting on column 0 (it is ignored)? I can't imagine why someone would do such a thing on purpose. |
||
| expect_data_frame(tab[-3], tbl[-3]) | ||
|
|
||
| expect_error(tab[[c(4, 3)]]) | ||
| expect_error(tab[[NA]], "'i' must be character or numeric, not logical") | ||
| expect_error(tab[[NULL]], "'i' must be character or numeric, not NULL") | ||
| expect_error(tab[[c("asdf", "jkl;")]], 'length(name) not equal to 1', fixed = TRUE) | ||
| expect_error(tab[-3], "Selections can't have negative value") # From tidyselect | ||
| expect_error(tab[-3:3], "Selections can't have negative value") # From tidyselect | ||
| expect_error(tab[1000]) # This is caught in vctrs, assert more specifically when it stabilizes | ||
| expect_error(tab[1:1000]) # same as ^ | ||
| expect_error(tab[-3:3], "Invalid column index") | ||
| expect_error(tab[1000], "Invalid column index") | ||
| expect_error(tab[1:1000], "Invalid column index") | ||
|
|
||
| skip("Table with 0 cols doesn't know how many rows it should have") | ||
| expect_data_frame(tab[0], tbl[0]) | ||
|
|
@@ -349,3 +349,12 @@ test_that("Table unifies dictionary on conversion back to R (ARROW-8374)", { | |
|
|
||
| expect_identical(as.data.frame(tab), res) | ||
| }) | ||
|
|
||
| test_that("Table$SelectColumns()", { | ||
| tab <- Table$create(x = 1:10, y = 1:10) | ||
|
|
||
| expect_equal(tab$SelectColumns(0L), Table$create(x = 1:10)) | ||
|
|
||
| expect_error(tab$SelectColumns(2:4)) | ||
| expect_error(tab$SelectColumns("")) | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.