Skip to content

Commit

Permalink
Improve groupby states (#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed May 3, 2022
1 parent 519096f commit c45e74c
Show file tree
Hide file tree
Showing 38 changed files with 348 additions and 632 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ mod test {
));

let groups = s.group_tuples(false, true);
let aggregated = s.agg_list(&groups).unwrap();
let aggregated = s.agg_list(&groups);
match aggregated.get(0) {
AnyValue::List(s) => {
assert!(matches!(s.dtype(), DataType::Categorical(_)));
Expand Down
4 changes: 2 additions & 2 deletions polars/polars-core/src/chunked_array/object/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ mod test {
let ca = ObjectChunked::new("", values);

let groups = GroupsProxy::Idx(vec![(0, vec![0, 1]), (2, vec![2]), (3, vec![3])].into());
let out = ca.agg_list(&groups).unwrap();
let out = ca.agg_list(&groups);
assert!(matches!(out.dtype(), DataType::List(_)));
assert_eq!(out.len(), groups.len());
}
Expand All @@ -214,7 +214,7 @@ mod test {
let ca = ObjectChunked::new("", values);

let groups = vec![(0, vec![0, 1]), (2, vec![2]), (3, vec![3])].into();
let out = ca.agg_list(&GroupsProxy::Idx(groups)).unwrap();
let out = ca.agg_list(&GroupsProxy::Idx(groups));
let a = out.explode().unwrap();

let ca_foo = a.as_any().downcast_ref::<ObjectChunked<Foo>>().unwrap();
Expand Down

0 comments on commit c45e74c

Please sign in to comment.