Skip to main content

StandardResult

The results of applying a standard to the tables of a source.

Usage

Source

StandardResult(
    *validations,
    standard=None,
    errors=None,
    order="given",
)

A StandardResult is what Standard.apply() returns. It holds an interrogated Validate object for each table that the standard was applied to, and answers the questions asked of a whole group of tables: did every table pass (passed), which ones failed (failing_tables()), and which ones the standard didn’t apply to (not_applicable_tables()).

It’s a kind of MultiValidate object, with a run for each table (in the order of the source), so all of its reports and roll-ups work too. Displaying the result shows every table’s validation report on one page, get_health_score(by="tbl_name") and get_dimension_scores(by="tbl_name") score each table, get_scorecard() gives the dimension scores of each table, and get_dataframe() gives all the results as one DataFrame. The validations can be saved with write_results() to follow the tables over time.

You don’t normally create a StandardResult yourself.

Attributes

standard

The Standard that was applied.

tables: dict[str, Validate]

A dictionary of the validation of each table, by the table’s name (in the order of the source). result.tables["orders"] is the same as result["orders"].

passed: bool

Whether every table passed: True when every test unit of every applicable step passed in each table’s validation (as with all_passed()) and every table could be read. Steps that don’t apply to a table don’t count.

errors: dict[str, Exception]
A dictionary of the tables that couldn’t be read (such as a database view whose query fails), with the exception raised for each. These tables have no validation, and they count as failing.

Examples

Let’s apply a standard for ID columns to three tables. Every column whose name ends with "_id" must be complete.

import pointblank as pb
import polars as pl

id_standard = pb.Standard(
    name="id-columns",
    steps=[pb.Step("col_vals_not_null", columns=pb.ends_with("_id"))],
)

result = id_standard.apply(
    {
        "orders": pl.DataFrame({"order_id": [1, 2], "customer_id": [5, None]}),
        "customers": pl.DataFrame({"customer_id": [5, 6], "name": ["Ann", "Bo"]}),
        "countries": pl.DataFrame({"code": ["FR", "JP"], "name": ["France", "Japan"]}),
    }
)

result
Standard: id-columns
FAIL
TABLES
3
PASS
1
FAIL
1
Not applicable
1
Health Score
83.33%
2026-12-04 20:43:46 UTC
STEPS
PASS
FAIL
Health Score
1PolarsordersStandard: id-columns
2026-12-04 20:43:46 UTC
2
1
1
75%
Standard: id-columns
Polarsorders
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C 1
col_vals_not_null
col_vals_not_null()
order_id — ✓ 2 2
1.00
0
0.00
— — — —
#4CA64C66 2
col_vals_not_null
col_vals_not_null()
customer_id — ✓ 2 1
0.50
1
0.50
— — —
2PolarscustomersStandard: id-columns
2026-12-04 20:43:46 UTC
1
1
0
100%
Standard: id-columns
Polarscustomers
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C 1
col_vals_not_null
col_vals_not_null()
customer_id — ✓ 2 2
1.00
0
0.00
— — — —
3PolarscountriesStandard: id-columns
2026-12-04 20:43:46 UTC
1
0
0
—
N/A
Standard: id-columns
Polarscountries
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C66 1
col_vals_not_null
col_vals_not_null()
EndsWith(text='_id', case_sensitive=False) — — — — — — — — —

Notes

Step 1 (not_applicable) Not applicable — The column expression EndsWith(text='_id', case_sensitive=False) does not resolve to any columns.

Printing the result lists the tables and their status:

print(result)
StandardResult: id-columns (3 tables)
  orders     2 steps  failed
  customers  1 step  passed
  countries  not applicable
All passed: no (2 of 3 tables passed)

The orders table has a missing customer ID, and the countries table has no ID column, so the standard doesn’t apply to it. The health score of each table shows how far each one is from meeting the standard:

result.get_health_score(by="tbl_name")
{'orders': 75.0, 'customers': 100.0}

A table with no applicable steps has no score, so countries isn’t in the dictionary.