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

Unify GT.cols_label() and GT.cols_width() to accept both cases and **kwargs #452

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

jrycw
Copy link
Collaborator

@jrycw jrycw commented Sep 18, 2024

This PR unifies GT.cols_label() and GT.cols_width() to accept both cases and **kwargs.

Currently, these two functions have different parameter structures, which can be confusing and often requires consulting the documentation. I hope this change simplifies their usage :)

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.75%. Comparing base (fedac08) to head (95708a5).

Files with missing lines Patch % Lines
great_tables/_spanners.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #452   +/-   ##
=======================================
  Coverage   86.75%   86.75%           
=======================================
  Files          42       42           
  Lines        4702     4711    +9     
=======================================
+ Hits         4079     4087    +8     
- Misses        623      624    +1     

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

@rich-iannone rich-iannone self-requested a review September 18, 2024 15:19
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

LGTM

@rich-iannone rich-iannone requested a review from machow September 18, 2024 15:23
@machow
Copy link
Collaborator

machow commented Sep 18, 2024

Thanks, this is great! I wonder if in the future, there might be some good uses of polars expressions inside cases, e.g.

cols_width({cs.starts_with("abc_"): "50px"})

Although maybe there's a more polars way to go from selector -> literal? 🤔

@machow machow merged commit fa8df51 into posit-dev:main Sep 18, 2024
13 checks passed
@jrycw jrycw deleted the cols-width-label branch September 18, 2024 16:15
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