-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(python) Series.index_of() and equivalent expression - Request for architectural review, take 2 #19408
Conversation
input: vec![self, element], | ||
function: FunctionExpr::IndexOf, | ||
options: FunctionOptions { | ||
// TODO which ApplyOptions, if any? |
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.
Is there a specific choice that makes sense here? I don't yet understand the enum options' meanings.
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 think wildcard expansion should be set to 2.
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19408 +/- ##
==========================================
- Coverage 80.03% 80.00% -0.03%
==========================================
Files 1528 1534 +6
Lines 209657 210840 +1183
Branches 2416 2443 +27
==========================================
+ Hits 167791 168675 +884
- Misses 41317 41610 +293
- Partials 549 555 +6 ☔ View full report in Codecov by Sentry. |
That start's to feel like a join. |
input: vec![self, element], | ||
function: FunctionExpr::IndexOf, | ||
options: FunctionOptions { | ||
// TODO which ApplyOptions, if any? |
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 think wildcard expansion should be set to 2.
.
T: PolarsNumericType, | ||
{ | ||
fn index_of(&'a self, value: Option<T::Native>) -> Option<usize> { | ||
// A NaN is never equal to anything, including itself. But we still want |
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 should be implemented over the chunks and not using an iterator over ChunkedArray's as they are really slow.
In the case we are looking for a None
we can also fast path to first null.
Goal is to fix a decent chunk of #5503 when finished. At this point it is more in the "am I in the right direction?" stage, though it does work for the implemented cases!
search_sorted()
has where it can search for multiple values in a single pass, so actually maybe better to leave it as is.Out of scope for this pass: