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): Replace _kwargs in collect method #19618

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jackxxu
Copy link

@jackxxu jackxxu commented Nov 3, 2024

when I was incorporating @ritchie46's suggestion in disabling CSE in the collect method in #19480, I initially used

ldf.collect(common_subplan_elim=False)

it didn't complain but produces no performance improvements that I was expecting, until I looked it up and found the keyword to be comm_subplan_elim instead.

this PR solves this potential pitfull for developers by replacing the _kwargs with spelled out keyword arguments, to let python do the checking for us and raise TypeError if not correct.

typically, unless a method either forwards/delegates the kwargs to another method or it takes whatever, it is reasonable to assume that the method spells out its interface.

@jackxxu jackxxu changed the title replace _kwargs in collect method fix(python): replace _kwargs in collect method Nov 3, 2024
@jackxxu jackxxu changed the title fix(python): replace _kwargs in collect method fix(python): Replace _kwargs in collect method Nov 3, 2024
@github-actions github-actions bot added fix Bug fix python Related to Python Polars and removed title needs formatting labels Nov 3, 2024
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.91%. Comparing base (0b0a914) to head (9272ff6).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19618      +/-   ##
==========================================
- Coverage   79.96%   79.91%   -0.05%     
==========================================
  Files        1536     1536              
  Lines      211374   211663     +289     
  Branches     2445     2447       +2     
==========================================
+ Hits       169034   169160     +126     
- Misses      41785    41948     +163     
  Partials      555      555              

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

@cmdlineluser
Copy link
Contributor

This will close #16525

@ritchie46
Copy link
Member

post_opt_callback is not intended for public use. It is private. We should instead check the content of _kwargs for items that aren't allowed (if any).

@jackxxu
Copy link
Author

jackxxu commented Nov 4, 2024

@ritchie46, commits added

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.

3 participants