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.
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.
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.