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: refactor column selection logic for Polars #360

Merged
merged 5 commits into from
May 23, 2024

Conversation

jrycw
Copy link
Contributor

@jrycw jrycw commented May 23, 2024

Related to #340, pola-rs/polars#16242, pola-rs/polars#16250.

This PR provides a quick fix for the column selection logic in Polars. Further investigation may be needed from the team.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.74%. Comparing base (b290e66) to head (7a7f825).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #360      +/-   ##
==========================================
+ Coverage   84.72%   85.74%   +1.02%     
==========================================
  Files          41       41              
  Lines        4346     4328      -18     
==========================================
+ Hits         3682     3711      +29     
+ Misses        664      617      -47     

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

@machow
Copy link
Collaborator

machow commented May 23, 2024

Shoot, thanks for catching this! It seems like there are three behaviors in the new polars release that broke our current approach (afaict this is just a side-effect of us living on the bleeding edge of expand_selector() 😈 ):

  1. quick fix: expand_selector() no longer accepts a list
  2. quick fix: expand_selector() no long accepts a raw string or int
  3. bigger discussion: expand_selector() only sometimes considers .exclude() a selector

I've opened an issue on polars RE the .exclude() behavior:

Copy link
Collaborator

@machow machow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the fixes (within 24 hours of the polars release 🤯 ). I hope it's okay, I tweaked a little bit to...

  • try and give a detailed error for when a list has things that aren't selectors
  • use functools reduce to accumulate selectors

We're going to make a small tweak to our CI, so we can quickly preview the docs builds for PRs off of forks, like this. And then should be able to merge!

@machow machow mentioned this pull request May 23, 2024
@machow
Copy link
Collaborator

machow commented May 23, 2024

Here is the docs preview I've pushed to a branch:

https://docs-preview-test--gt-python.netlify.app/articles/intro.html

@machow machow merged commit 6b2624b into posit-dev:main May 23, 2024
13 checks passed
@jrycw
Copy link
Contributor Author

jrycw commented May 24, 2024

@machow and @rich-iannone , everything looks great. It seems the developers from Polars are actively supporting and clarifying our use case, which is fantastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants