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

blog: add blog post promoting the mask= parameter in loc.body() #584

Merged
merged 7 commits into from
Jan 27, 2025

Conversation

jrycw
Copy link
Collaborator

@jrycw jrycw commented Jan 23, 2025

Hello team,

I'd like to propose a blog post to promote the new mask= parameter in loc.body(). Feedback is always welcome!

The post is relatively short, and perhaps the team could extract some content to incorporate into the release blog for 0.16.0.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.73%. Comparing base (d9b4db6) to head (f65ecff).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #584   +/-   ##
=======================================
  Coverage   90.73%   90.73%           
=======================================
  Files          46       46           
  Lines        5416     5416           
=======================================
  Hits         4914     4914           
  Misses        502      502           

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

@jrycw
Copy link
Collaborator Author

jrycw commented Jan 23, 2025

By the way, has anyone noticed that we've hit 2000 stars? 🎉

@github-actions github-actions bot temporarily deployed to docs-preview-blog-locbody-mask January 23, 2025 17:25 Destroyed
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.

Yo, this article is so handy! WDYT of moving the 3rd section, where you demonstrate mask= up to be the top one (instead of for-loop). This way, people get the most desirable nice thing up front. I think one demo of a painful alternative would be okay, but wonder if two might start to drag a bit (@rich-iannone mentioned preferring the list to loc body demo vs the for loop).

What about this?

  • mask example up top
  • two mask example sections, so people get to see it shine (e.g. @rich-iannone suggested a second section showing you style nulls)
  • a final section showing one painful alternative (maybe the list to loc.body() approach?)

In any event, mask is a killer feature -- so really appreciate you contributing it AND this post 😁

@jrycw
Copy link
Collaborator Author

jrycw commented Jan 24, 2025

@rich-iannone and @machow, thanks for the prompt feedback.

I ended up doing the following modifications:

  • Moved the mask= example up, and used two calls to GT.tab_style() in this example to demonstrate how we can use both Polars selectors AND expressions based on user preferences. Additionally, I highlighted that dynamically identifying columns is particularly useful in pivoted operations.
  • Kept the list to loc.body() approach and compared it with the first approach.

I hope these changes make sense to you. Please feel free to comment if something doesn't.

By the way, may I ask for the privilege to trigger preview docs (not the official deployment environment) so I can immediately check whether the style looks right?

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.

Yooo this is looking really nice. I noticed that the black fill for null values is quite strong. WDYT of making null value text color "grey" or "lightgrey"? That way, the effect is similar to fading out missing values, so they're less prominent.

image

Otherwise, the article looks really great -- thanks again for this, we'll release the new version in a sec, and are pumped to share the post!

No need to include us as authors -- you definitely did all the work here 😁

(We're looking into making previews easier for you to trigger)

@rich-iannone
Copy link
Member

We released 0.16.0 and, shortly after that, 0.16.1 to fix the incorrect dtype for the year column in gtcars: https://github.com/posit-dev/great-tables/releases/tag/v0.16.1. So if you update the package, you can change your year_cols line to this:

year_cols = ["2014", "2015", "2016", "2017"]

and we'll get properly-formatted years as column names.

@jrycw
Copy link
Collaborator Author

jrycw commented Jan 25, 2025

@machow and @rich-iannone, thank you for the feedback. I've updated the background color to lightgrey for improved readability and revised the column names accordingly.

image

@rich-iannone
Copy link
Member

Thanks so much for this post (and thank you for your patience with our suggestions). We'll likely merge this Monday morning and then do some announcements around this post and the v0.16.0 release!

@rich-iannone rich-iannone merged commit f95fcf0 into posit-dev:main Jan 27, 2025
14 checks passed
@jrycw jrycw deleted the blog-locbody-mask branch January 27, 2025 15:26
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