-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
refactor: Get Column
into polars-expr
#19660
refactor: Get Column
into polars-expr
#19660
Conversation
let length = output_length(l, r)?; | ||
match (l, r) { | ||
(Column::Series(l), Column::Scalar(r)) => { | ||
let r = r.as_single_value_series(); |
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.
This was not functioning properly for series with length=0, so I replaced it with Column::try_apply_broadcasting_binary_elementwise
.
self.as_materialized_series() | ||
.bitand(rhs.as_materialized_series()) | ||
.map(Column::from) | ||
} | ||
pub fn bitor(&self, rhs: &Self) -> PolarsResult<Self> { |
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 really understand why we have these and std::ops::BitAnd, etc. on Series.
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.
Me neither. Maybe we can try to remove it in a follow op.
@@ -15,7 +15,7 @@ impl Series { | |||
} | |||
|
|||
#[doc(hidden)] | |||
pub fn agg_valid_count(&self, groups: &GroupsProxy) -> Series { | |||
pub unsafe fn agg_valid_count(&self, groups: &GroupsProxy) -> Series { |
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.
This was before incorrectly marked as safe
@@ -139,8 +139,8 @@ impl Executor for JoinExec { | |||
|
|||
let df = df_left._join_impl( | |||
&df_right, | |||
left_on_series, | |||
right_on_series, | |||
left_on_series.into_iter().map(|c| c.take_materialized_series()).collect(), |
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 really think this is a very large optimization problem, but hopefully this can be resolved when Column
is fully in polars-expr
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19660 +/- ##
==========================================
- Coverage 79.86% 79.74% -0.12%
==========================================
Files 1537 1541 +4
Lines 211923 212214 +291
Branches 2446 2446
==========================================
- Hits 169249 169229 -20
- Misses 42120 42431 +311
Partials 554 554 ☔ View full report in Codecov by Sentry. |
Nice! |
This starts the moving of
Column
intopolars-expr
. I tried to keep this PR to a minimal, and will do the follow-up in other PRs.For example, what this PR allows:
This can now finally produces a
Column::Scalar
instead of having to materialize to aColumn::Series
.