import pointblank as pb
import polars as pl
import tempfile
from pathlib import Path
standards_dir = Path(tempfile.mkdtemp())
pb.Standard(
name="amounts",
steps=[pb.Step("col_vals_ge", columns=pb.ends_with("_amount"), value=0)],
).to_yaml(standards_dir / "amounts.yaml")
pb.Standard(
name="ids",
steps=[pb.Step("col_vals_not_null", columns=pb.ends_with("_id"))],
).to_yaml(standards_dir / "ids.yaml")
tables = {
"orders": pl.DataFrame({"order_id": [1, 2], "order_amount": [20.0, -5.0]}),
"refunds": pl.DataFrame({"refund_id": [1, None], "refund_amount": [3.0, 4.0]}),
"regions": pl.DataFrame({"region": ["EU", "US"]}),
}
results = pb.StandardsRegistry(standards_dir).apply_all(tables)
results["amounts"]1Polarsorders2026-12-04 20:43:51 UTC10150%
2Polarsrefunds2026-12-04 20:43:51 UTC110100%
Standard: amounts Polarsrefunds |
|||||||||||||
| STEP | COLUMNS | VALUES | TBL | EVAL | UNITS | PASS | FAIL | W | E | C | EXT | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| #4CA64C | 1 |
col_vals_ge()
|
✓ | 2 | 2 1.00 |
0 0.00 |
— | — | — | — | |||
3Polarsregions2026-12-04 20:43:51 UTC100—N/A
Standard: amounts Polarsregions |
|||||||||||||
| STEP | COLUMNS | VALUES | TBL | EVAL | UNITS | PASS | FAIL | W | E | C | EXT | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| #4CA64C66 | 1 |
col_vals_ge()
|
— | — | — | — | — | — | — | — | |||
Notes Step 1 (not_applicable) Not applicable — The column expression | |||||||||||||