Skip to content

Commit

Permalink
python polars 0.13.28
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed May 1, 2022
1 parent 3bbe110 commit f3c9898
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
8 changes: 1 addition & 7 deletions polars/polars-lazy/src/physical_plan/planner/lp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,9 @@ impl DefaultPlanner {
| AAggExpr::Mean(_)
| AAggExpr::Last(_)
| AAggExpr::First(_)
| AAggExpr::Count(_)
)
},
// TODO: first fix make proper final implementation
// BinaryExpr {left, right, ..} => {
// matches!(expr_arena.get(*left), Literal(_) | Column(_)) &&
// matches!(expr_arena.get(*right), Literal(_) | Column(_))
// }
Literal(_) | Not(_) | IsNotNull(_) | IsNull(_) | Column(_) | Count | Alias(_, _) => {
Column(_) | Alias(_, _) => {
true
}
_ => {
Expand Down
20 changes: 20 additions & 0 deletions polars/polars-lazy/src/tests/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,7 @@ fn test_is_in() -> Result<()> {

#[test]
fn test_partitioned_gb() -> Result<()> {
// don't move these to integration tests
// keep these dtypes
let out = df![
"keys" => [1, 1, 1, 1, 2],
Expand All @@ -1981,3 +1982,22 @@ fn test_partitioned_gb() -> Result<()> {

Ok(())
}

#[test]
fn test_partitioned_gb_count() -> Result<()> {
// don't move these to integration tests
let out = df![
"col" => (0..100).map(|_| Some(0)).collect::<Int32Chunked>().into_series(),
]?
.lazy()
.groupby([col("col")])
.agg([count().alias("count")])
.collect()?;

assert!(out.frame_equal(&df![
"col" => [0],
"count" => [100 as IdxSize],
]?));

Ok(())
}
2 changes: 1 addition & 1 deletion py-polars/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion py-polars/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-polars"
version = "0.13.26"
version = "0.13.28"
authors = ["ritchie46 <ritchie46@gmail.com>"]
documentation = "https://pola-rs.github.io/polars/py-polars/html/reference/index.html"
edition = "2021"
Expand Down

0 comments on commit f3c9898

Please sign in to comment.