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): Address overly-permissive expand_selectors function, minor fixes #16250

Merged
merged 2 commits into from
May 16, 2024

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented May 15, 2024

Closes #16242 (ref: #16242 (comment)).

Fixes incomplete validation in is_selector, taking care of expand_selector in the process (it should have been raising a TypeError on non-selector input). Now that it's fixed, can use is_selector inside _selector_proxy_ (in retrospect it was a bit of a red flag that we couldn't already do this ;p)

Also:

  • Fixes invalid uses of __sub__ and __rsub__.
  • Adds an example to clarify as_expr usage.
  • Adds missing entries to module __all__.
  • Adds a few more user guide examples.
  • Adds some missing test coverage.
  • Removes a few lines of dead code.

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 80.88%. Comparing base (a34ca2c) to head (14bfc92).
Report is 4 commits behind head on main.

Files Patch % Lines
py-polars/polars/selectors.py 76.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16250      +/-   ##
==========================================
+ Coverage   80.83%   80.88%   +0.05%     
==========================================
  Files        1394     1393       -1     
  Lines      180095   179167     -928     
  Branches     2913     2913              
==========================================
- Hits       145577   144922     -655     
+ Misses      34015    33743     -272     
+ Partials      503      502       -1     

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

@alexander-beedie alexander-beedie changed the title fix(python): Address overly-permissive expand_selectors function fix(python): Address overly-permissive expand_selectors function, minor fixes May 16, 2024
@ritchie46 ritchie46 merged commit 0db380b into pola-rs:main May 16, 2024
18 checks passed
@alexander-beedie alexander-beedie deleted the fix-selector-check branch May 16, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-selectors Area: column selectors fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expand_selectors returns resulting column names, rather than selected column names
2 participants