What Are SDF Tests?
x > 100
)sum(x) > 100
)Setup
workspace.sdf.yml
file, uncomment the following:inapp_events
staging model located in
models/staging/inapp_events
.To add tests to the model, we need to create a YML file to hold the model’s metadata.Under metadata/staging
, create a new file called inapp_events.sdf.yml
containing the following definition:Scalar Column Tests
valid_scalar(condition)
where condition = event_value >=0
.
Add to the newly created YML file the following test:"""condition"""
[Pass] Test moms_flower_shop.staging.test_inapp_events
Aggregate Column Tests
event_value
and assert whether it is positive.Let’s add the new test to the YML file:[Pass] Test moms_flower_shop.staging.test_inapp_events
Table Tests
"col_name"
.[Pass] Test moms_flower_shop.staging.test_inapp_events