Context
- the team is slowly becoming a bottleneck in the organization (thus automated pipelines are expected to release the operational burden and reduce thoughts behind materialization strategies, debugging incremental refreshes and rerunning pipelines affected by source data issues which sneaked out of sight)
- for cost optimization - the organization is considering a move off Prefect, thus removing the need of an orchestrator for the data pipelines would work hand-in-hand with this; the team is already using serverless ingestion using Snowpipes, thus using Dynamic Tables for downstream transformations would remove the need for imperative data pipelines
The testing gap
- not_null and accepted_values, for column assertions
- for testing primary keys and foreign keys we adopted the use of the Snowflake-labs/dbt_constraints package - as it not only runs the tests, but it also handles pushing constraints to Snowflake automatically
- source_freshness tests for key data providers
- some isolated singular DBT tests (covering complex expectations in terms of the relationship between business entities in our models)
- soft data quality tests — a custom-built, non-blocking, row-level, propagated violations flagging mechanism
- data distribution profiles, for detecting unusual patterns in data and data distribution without the usage of explicit expectations or assertions
Trying out DMFs to close the testing gap
These insights enhance your data governance posture by enabling the following:
- Data stewards to know the current state of their data based on a particular metric.
- Data engineers to take immediate action on important tables and views.
- Platform administrators to ensure data quality monitoring is done with cost, consistency, and performance.
Designing the future testing framework
- DMFs don’t allow the customizations we need, despite built as a special database objects similar to UDFs (for example, test parametrization or running custom DML).
- The test assertion mechanism seems completely left out, as Snowflake only provides a mechanism to create tasks but no standard mechanism for assertions and alerting. Additionally, the tasks annot even be triggered by test executions, but rather just on CRON.
