feat: Broadcast scalar input for list.slice#27487
feat: Broadcast scalar input for list.slice#27487Kevin-Patyk wants to merge 4 commits intopola-rs:mainfrom
list.slice#27487Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27487 +/- ##
==========================================
+ Coverage 81.14% 81.62% +0.48%
==========================================
Files 1834 1834
Lines 254891 254895 +4
Branches 3177 3177
==========================================
+ Hits 206823 208054 +1231
+ Misses 47246 46019 -1227
Partials 822 822 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nameexhaustion
left a comment
There was a problem hiding this comment.
What about the other codepaths? I'd expect this to be 3-way broadcastable.
|
@nameexhaustion Good callout. Moved the condition outside of the match arms and updated the test cover different broadcasting situations. |
| let length_s = &args[2]; | ||
|
|
||
| let target_len = offset_s.len().max(length_s.len()); | ||
| let list_ca = if list_ca.len() == 1 && target_len > 1 { |
There was a problem hiding this comment.
It can be prohibitively expensive to be repeating the list values for each row; I'd have expected the implementation to have a kernel that can directly construct the output off of the single input row.
There was a problem hiding this comment.
Okay I will look into it! 👍
Resolves #27480.
For the broadcasting, I used
new_from_index()because it was already an established pattern being used inconcat().🤖 Claude Sonnet 4.6 for navigating the codebase.