-
Notifications
You must be signed in to change notification settings - Fork 38
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
Accept lists in select()
#265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome 🏆 🚀
test_that("select with list of exprs", { | ||
l_expr = list(pl$col("mpg"), pl$col("hp")) | ||
l_expr2 = list(pl$col("mpg", "hp")) | ||
l_expr3 = list(pl$col("mpg")) | ||
l_expr4 = list(c("mpg", "hp")) | ||
l_expr5 = list("mpg", "hp") | ||
|
||
x1 = pl$DataFrame(mtcars)$select(l_expr) | ||
x2 = pl$DataFrame(mtcars)$select(l_expr2) | ||
x3 = pl$DataFrame(mtcars)$select(l_expr3, pl$col("hp")) | ||
x4 = pl$DataFrame(mtcars)$select(pl$col("hp"), l_expr3) | ||
x5 = pl$DataFrame(mtcars)$select(l_expr4) | ||
x6 = pl$DataFrame(mtcars)$select(l_expr5) | ||
|
||
expect_equal(x1$columns, c("mpg", "hp")) | ||
expect_equal(x2$columns, c("mpg", "hp")) | ||
expect_equal(x3$columns, c("mpg", "hp")) | ||
expect_equal(x4$columns, c("mpg", "hp")) | ||
expect_equal(x5$columns, c("mpg", "hp")) | ||
expect_equal(x6$columns, c("mpg", "hp")) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose these tests can be simplify by patrick
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used patrick
, I find the tests hard to read (but feel free to modify those ofc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind patrick for large combinatorial tests. Looks neat. I find, that if a patrick test fails, and it is not immediately clear to me why, then I will spend more time than normal to debug the test.
Related to #259 (I couldn't deprecate
construct_ProtoExprArray
though so no problem to close this PR if you want to do it all at once in another PR).New behaviour: