-
Notifications
You must be signed in to change notification settings - Fork 2.5k
refactor: Add ElementExpr for _eval expressions
#25199
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25199 +/- ##
==========================================
- Coverage 81.81% 81.79% -0.02%
==========================================
Files 1709 1712 +3
Lines 236261 236496 +235
Branches 3005 3007 +2
==========================================
+ Hits 193292 193440 +148
- Misses 42201 42287 +86
- Partials 768 769 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| out = df.select(pl.col.a.list.eval(expr).over(42)) | ||
| print(out) | ||
| print(df) |
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.
Remove stray prints
| branch_idx: self.branch_idx, | ||
| flags: self.flags.clone(), | ||
| ext_contexts: self.ext_contexts.clone(), | ||
| element: self.element.clone(), |
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.
Are we certain this should clone here? Otherwise I think we should be conservative and clear it.
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 would lead to problems, as .split() is also called in BinaryExpr and TernaryExpr and thus would clear the element for different inputs.
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 see. We should add a test case for this then, I imagine it's hit by something like list.eval(pl.when(pl.element()..).then(pl.element()..))
This PR introduces
ElementExprand extends the in-memory engine physicalExecutionStatesuch that any input, once evaluated, is retained forpl.element().