Skip to content

Instantly share code, notes, and snippets.

View b-ned's full-sized avatar

Bas Nederkoorn b-ned

View GitHub Profile
{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.11.8", "generated_at": "2026-05-01T10:01:56.861461Z", "invocation_id": "1df47354-1517-4dc3-8790-7d680cb5e0b0", "invocation_started_at": "2026-04-17T21:36:40.893126+00:00", "env": {}, "project_name": "finance_core", "project_id": "101955a30cc77527324a05a0c312e53b", "user_id": "da1226d8-40b4-4126-971e-837c1a2ee87d", "send_anonymous_usage_stats": true, "adapter_type": "duckdb", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-04-17T21:36:40.893313+00:00"}, "nodes": {"model.finance_core.int_invoice_aging": {"database": "finance_core", "schema": "main", "name": "int_invoice_aging", "resource_type": "model", "package_name": "finance_core", "path": "intermediate/int_invoice_aging.sql", "original_file_path": "models/intermediate/int_invoice_aging.sql", "unique_id": "model.finance_core.int_invoice_aging", "fqn": ["finance_core", "intermediate", "int_invoice
{
"metadata": {
"colibri_version": "0.3.0",
"generated_at": "2026-05-01T09:55:54Z",
"adapter_type": "duckdb",
"dbt_version": "1.11.8",
"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json",
"dbt_invocation_id": "5cc20af6-c828-4778-a8bc-f558fb6e2b97",
"dbt_project_name": "finance_core",
"dbt_project_id": "2e8b50802aa26764",
{
"metadata": {
"colibri_version": "0.3.0",
"generated_at": "2026-05-01T09:55:54Z",
"adapter_type": "duckdb",
"dbt_version": "1.11.8",
"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json",
"dbt_invocation_id": "5cc20af6-c828-4778-a8bc-f558fb6e2b97",
"dbt_project_name": "finance_core",
"dbt_project_id": "2e8b50802aa26764",
{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.11.8", "generated_at": "2026-05-01T09:55:53.342855Z", "invocation_id": "5cc20af6-c828-4778-a8bc-f558fb6e2b97", "invocation_started_at": "2026-05-01T09:55:51.866503Z", "env": {}}, "nodes": {"model.finance_core.ar_aging_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "ar_aging_snapshot", "database": "finance_core", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INTEGER", "index": 1, "name": "customer_id", "comment": null}, "customer_name": {"type": "VARCHAR", "index": 2, "name": "customer_name", "comment": null}, "country_code": {"type": "VARCHAR", "index": 3, "name": "country_code", "comment": null}, "aging_bucket": {"type": "VARCHAR", "index": 4, "name": "aging_bucket", "comment": null}, "open_invoices": {"type": "BIGINT", "index": 5, "name": "open_invoices", "comment": null}, "outstanding_amount": {"type": "DOUBLE", "index": 6, "name": "outstanding_amount", "
from google.cloud import bigquery
import datetime
import pandas as pd
import json
from test_config import test_configs
# BigQuery Project Configuration
test_log_table = 'mydataset.test_results'
project="my-project"
class BigQueryUniquenessTest:
def __init__(self, client, table_name, column_name):
self.table_name = table_name
self.column_name = column_name
self.client = client
self.status = None
self.name = f"{self.table_name}-{self.column_name}-unique"
self.labels = {
"dest_table": table_name,
"column_name": column_name,
from test_classes import BigQueryUniquenessTest
test_configs = [
{
'class': BigQueryUniquenessTest,
'test_params':
{
'table_name': 'mydataset.transaction_fact',
'column_name': 'transaction_id'
}
cachetools==5.3.0
charset-normalizer==3.0.1
db-dtypes==1.0.5
google-api-core==2.11.0
google-auth==2.16.0
google-auth-oauthlib==0.8.0
google-cloud-bigquery==3.4.2
google-cloud-bigquery-storage==2.18.1
google-cloud-core==2.3.2
google-crc32c==1.5.0
SELECT
IF(
-- Condition
(SELECT COUNT(*) FROM `mydataset.mytable` WHERE email IS NULL) = 0,
-- Return when True:
'Test Successful',
-- Return Error when False:
ERROR('Error: Found NULL values in email column of `mydataset.mytable`!'))
SELECT COUNT(*) FROM `mydataset.mytable`
WHERE email IS NULL