Skip to content

Conversation

@rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Mar 29, 2025

This PR utilizes the lang parameter (from the Validate class) for the validation report table. This translates various elements of the reporting table (the default title, certain column headers).

With the following validation code (using lang="zh-Hant")

import pointblank as pb
import polars as pl

parquet_polars = pl.read_parquet(source="yellow_tripdata_2009-01.parquet")

validation = (
    pb.Validate(data=parquet_polars, brief=True, lang="zh-Hant")
    .col_vals_in_set(columns="vendor_name", set=["VTS", "DDS", "CMT"])
    .col_vals_lt(columns="Passenger_Count", value=1, na_pass=True)
    .col_vals_gt(
        columns=["Trip_Distance", "Fare_Amt", "surcharge", "Tip_Amt", "Tolls_Amt", "Total_Amt"],
        value=0,
        na_pass=True,
    )
    .col_vals_between(columns=["Start_Lon", "End_Lon"], left=-75, right=-73)
    .interrogate(collect_tbl_checked=False)
)

validation

We get the following localized validation report table:

image

With locale="de":

image

A locale= value can be provided to override the formatting that's taken from the lang= value.

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.04%. Comparing base (ee5afeb) to head (1ac8621).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #131   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files          17       17           
  Lines        3651     3653    +2     
=======================================
+ Hits         3616     3618    +2     
  Misses         35       35           

☔ 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 March 29, 2025 01:37
@rich-iannone rich-iannone merged commit b50c172 into main Mar 29, 2025
5 checks passed
@rich-iannone rich-iannone deleted the feat-translate-validation-report branch March 29, 2025 01:39
@rich-iannone
Copy link
Member Author

Hey @jrycw this is that localization I was talking about before. It’s now merged and I’ll release pretty soon with this functionality!

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