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

feat: Implements agg_list for NullChunked #15439

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Apr 2, 2024

We must implements agg_list for NullChunked, otherwise it will be dispatched to the default implementation which doesn't produce a list series.

This fixes #15437.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Apr 2, 2024
@@ -183,6 +188,10 @@ impl SeriesTrait for NullChunked {
NullChunked::new(self.name.clone(), self.len()).into_series()
}

fn drop_nulls(&self) -> Series {
NullChunked::new(self.name.clone(), 0).into_series()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not much, but it should be better than the default implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is free.

@reswqa reswqa marked this pull request as ready for review April 2, 2024 13:03
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 81.13%. Comparing base (e3c2b0d) to head (9b00377).
Report is 1 commits behind head on main.

Files Patch % Lines
...s-core/src/frame/group_by/aggregations/agg_list.rs 60.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15439   +/-   ##
=======================================
  Coverage   81.13%   81.13%           
=======================================
  Files        1362     1362           
  Lines      174820   174846   +26     
  Branches     2531     2531           
=======================================
+ Hits       141836   141865   +29     
+ Misses      32500    32497    -3     
  Partials      484      484           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -183,6 +188,10 @@ impl SeriesTrait for NullChunked {
NullChunked::new(self.name.clone(), self.len()).into_series()
}

fn drop_nulls(&self) -> Series {
NullChunked::new(self.name.clone(), 0).into_series()
Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is free.

@ritchie46 ritchie46 merged commit 802d6c8 into pola-rs:main Apr 2, 2024
23 checks passed
@reswqa reswqa deleted the null_agg_list branch April 2, 2024 13:59
nameexhaustion pushed a commit to nameexhaustion/polars that referenced this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected behaviour of pl.Expr.over
2 participants