Skip to content

feat: better customize header in step reports (through .get_step_report(header=...)#142

Merged
rich-iannone merged 8 commits intomainfrom
feat-step-report-header-customize
Apr 3, 2025
Merged

feat: better customize header in step reports (through .get_step_report(header=...)#142
rich-iannone merged 8 commits intomainfrom
feat-step-report-header-customize

Conversation

@rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Apr 3, 2025

This PR makes a second attempt to better let the user customize the header in a step report. Previously, the header= arg would accept text that would completely replace the header. However, the header in a step report consists of a title element and a larger details element. You couldn't replace only the title portion without wiping out the details part in the process.

Here, we allow for use of templating, where the default template is "{title}{details}" (and header=":default:" calls up this standard template). If you wanted to replace the title and keep the details, you'd supply "Custom Title {details}". Here's an example:

import pointblank as pb

validation = (
    pb.Validate(data=pb.load_dataset(dataset="game_revenue", tbl_type="polars"))
    .col_vals_lt(columns="item_revenue", value=200)
    .col_vals_gt(columns="item_revenue", value=0)
    .col_vals_gt(columns="session_duration", value=5)
    .col_vals_in_set(columns="item_type", set=["iap", "ad"])
    .col_vals_regex(columns="player_id", pattern=r"[A-Z]{12}\d{3}")
    .interrogate()
)

validation.get_step_report(
    i=3,
    header="Custom Title {details}",
)
image

Fixes: #111

@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.14%. Comparing base (f09a8bb) to head (7fc14e3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #142   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files          17       17           
  Lines        3721     3739   +18     
=======================================
+ Hits         3689     3707   +18     
  Misses         32       32           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rich-iannone rich-iannone marked this pull request as ready for review April 3, 2025 01:36
@rich-iannone rich-iannone merged commit 6124efc into main Apr 3, 2025
5 checks passed
@rich-iannone rich-iannone deleted the feat-step-report-header-customize branch April 3, 2025 01:41
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.

feat: customizable titles for outputs of get_step_report()

2 participants