How to run conditional checks.
include_tests=True
on the Report level. (Default: False).
DataSummaryPreset()
Report simply shows descriptive stats of your data, adding the Tests will additionally run multiple checks on data quality and expected column statistics.
The automatic Test conditions can either
eval_data_1
is the current data you evaluate, the second eval_data_2
is the reference dataset you consider as a baseline and use to generate test conditions.include_Tests
option:
tests
to None
or leave empty:
MinValue()
with auto-generated conditions.
tests
and set expected behavior using parameters like gt
(greater than), lt
(less than), eq
(equal).
For example, to verify that there are no missing values and no values below 18 in the “Age” column:
include_tests
when setting Tests manually.
tests
parameter applies when a metric returns a single value, or to test count
for metrics that return both count
and share
. For metrics with multiple outputs (e.g. MAE returns mean
and std
), you may need to use specific test parameters like mean_tests
and std_tests
. You can check metric outputs at the All Metric page.Condition | Explanation | Example |
---|---|---|
eq(val) | equal to test_result == val | MinValue(column="Age", tests=[eq(18)]) |
not_eq(val) | not equal test_result != val | MinValue(column="Age", tests=[not_eq(18)]) |
gt(val) | greater than test_result > val | MinValue(column="Age", tests=[gt(18)]) |
gte(val) | greater than or equal test_result >= val | MinValue(column="Age", tests=[gte(18)]) |
lt(val) | less than test_result < val | MinValue(column="Age", tests=[lt(18)]) |
lte(val) | less than or equal test_result <= val | MinValue(column="Age", tests=[lte(18)]) |
is_in: list | test_result == one of the values | MinValue(column="Age", tests=[is_in([18, 21, 30])]) |
not_in: list | test_result != any of the values | MinValue(column="Age", tests=[not_in([16, 17, 18])]) |
include_tests=True
and adding custom conditions where needed.
MissingValueCount
or CategoryCount
return both absolute counts and percentage. The default tests
parameter lets you set condition against the absolute value. To test the relative value, use share_tests
parameter.
To test for fewer than 5 missing values (absolute):
is_critical=False
: