-
Notifications
You must be signed in to change notification settings - Fork 171
fix: BaseFrame.filter with list[bool] in predicates
#3183
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
Conversation
|
You're more than welcome to steal these test cases π I was pretty surprised at how short the test suite was for |
| if ( | ||
| len(predicates) == 1 and is_list_of(predicates[0], bool) and not constraints | ||
| ): # pragma: no cover |
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 covering full spectrum of possibilities
This comment was marked as resolved.
This comment was marked as resolved.
Move whatever is going on here into a new guard function like those in Any time the logic starts getting hard to follow, Edit: I don't recommend putting everything in one method like this, but the polars logic has a few tricks to draw from |
|
@FBruzzesi I just added more tests from upstream: The last 2 would cover (df7acdd#r167422933) |
MarcoGorelli
left a comment
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.
thanks both!
|
@MarcoGorelli just to clarify (#3183 (comment)) and feel free to ignore if it was clear already I somehow managed to start a thread that isn't showing on the PR π And the commit I linked (which has more tests) is from (#3173). I'm just trying to avoid the same bug I fixed in (pola-rs/polars#16254) from being introduced here π |
(public to the rest of narwhals) The module itself is private already
|
@dangotbanned if you are happy with the state of this, let's merge :) |
Will do one more once over for (#3183 (comment)), but we should be good to merge later π I've gotten a bit distracted by #3188, which we might need to fix upstream |
dangotbanned
left a comment
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.
Thanks @FBruzzesi, provided I've not broken an edge case on an old version in (#3183 (comment)) - looks ready to merge

What type of PR is this? (check all applicable)
Related issues
DataFrame.filtersilently ignores**constraintswhen usinglist[bool]Β #3182Checklist
If you have comments or can explain your changes, please do so below