On how this compares to alternatives - the way we think about it is theres kind of 3 layers. DQ monitors check if your data is healthy after its already in prod (anomalies, freshness, etc). dbt tests verify your models are sound during deployment (constraints, relationships, schema).
What was missing for us was testing the actual business logic before you deploy. for example, does this calculation actually return what you expect for these inputs.
This framework lets you define mock tables as dataclasses, inject via CTEs so its fast, and validate your logic in development before it ever hits prod. same test works across warehouses too which was useful when we were evaluating migrations. also its not tied to dbt or any specific framework
I built a small open-source tool called sqltesting to test SQL transformations using mock tables + assertions. It works with BigQuery, Snowflake, Redshift, Athena, Trino, and DuckDB. Also made mocksmith library to generate realistic test data by simply adding mockable annotation on existing classes
Curious how others test SQL logic today. Do you write tests, or just rely on warehouse runs?
Co-author here. happy to answer questions.
On how this compares to alternatives - the way we think about it is theres kind of 3 layers. DQ monitors check if your data is healthy after its already in prod (anomalies, freshness, etc). dbt tests verify your models are sound during deployment (constraints, relationships, schema).
What was missing for us was testing the actual business logic before you deploy. for example, does this calculation actually return what you expect for these inputs.
This framework lets you define mock tables as dataclasses, inject via CTEs so its fast, and validate your logic in development before it ever hits prod. same test works across warehouses too which was useful when we were evaluating migrations. also its not tied to dbt or any specific framework
I built a small open-source tool called sqltesting to test SQL transformations using mock tables + assertions. It works with BigQuery, Snowflake, Redshift, Athena, Trino, and DuckDB. Also made mocksmith library to generate realistic test data by simply adding mockable annotation on existing classes
Curious how others test SQL logic today. Do you write tests, or just rely on warehouse runs?