Skip to content
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

fix(python): Handle non-Sequence iterables in filter #16254

Merged
merged 7 commits into from
May 22, 2024

Conversation

dangotbanned
Copy link
Contributor

@dangotbanned dangotbanned commented May 15, 2024

Fixes #16253

I tried to keep the logic as close to the original as possible.
E.g, prioritising the fast paths.

Was wondering if the is_sequence check that follows is the best option though.

Edit:
To elaborate on the is_sequence comment further.

Acceptable inputs at that stage are:

  1. One or more Expr
  2. An str representing a column name in self.columns
  3. A Sequence that is not a Series

Where parsing 3 is defered to parse_as_list_of_expressions.

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.37%. Comparing base (ec08d76) to head (1c5ebd9).
Report is 6 commits behind head on main.

Current head 1c5ebd9 differs from pull request most recent head 4bfd044

Please upload reports for the commit 4bfd044 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16254      +/-   ##
==========================================
- Coverage   81.39%   81.37%   -0.03%     
==========================================
  Files        1406     1406              
  Lines      183953   183955       +2     
  Branches     2958     2959       +1     
==========================================
- Hits       149731   149694      -37     
- Misses      33709    33748      +39     
  Partials      513      513              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dangotbanned
Copy link
Contributor Author

@alexander-beedie hoping this is good to go now

@alexander-beedie alexander-beedie merged commit d1cf113 into pola-rs:main May 22, 2024
14 checks passed
@dangotbanned dangotbanned deleted the fix-filter-predicate branch May 22, 2024 11:35
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LazyFrame.filter fails to parse non-Sequence iterables
3 participants