{"id":47883198,"url":"https://github.com/llucmh/dbt-checks","last_synced_at":"2026-04-04T02:01:35.160Z","repository":{"id":343108850,"uuid":"1099372452","full_name":"LlucMH/dbt-checks","owner":"LlucMH","description":"Reusable, declarative data quality checks for dbt projects.","archived":false,"fork":false,"pushed_at":"2026-04-03T23:11:28.000Z","size":2006,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T23:26:18.003Z","etag":null,"topics":["analytics","analytics-engineering","bigquery","data-quality","data-quality-checks","data-validation","data-validation-library","databricks","date-engineering","dbt","duckdb","postgres","snowflake","sql","testing","testing-framework","testing-tool"],"latest_commit_sha":null,"homepage":"https://github.com/LlucMH/dbt-checks","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LlucMH.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-18T23:02:38.000Z","updated_at":"2026-04-03T23:09:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/LlucMH/dbt-checks","commit_stats":null,"previous_names":["llucmh/dbt-checks"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/LlucMH/dbt-checks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LlucMH%2Fdbt-checks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LlucMH%2Fdbt-checks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LlucMH%2Fdbt-checks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LlucMH%2Fdbt-checks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LlucMH","download_url":"https://codeload.github.com/LlucMH/dbt-checks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LlucMH%2Fdbt-checks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31384847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T01:22:39.193Z","status":"online","status_checked_at":"2026-04-04T02:00:07.569Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-engineering","bigquery","data-quality","data-quality-checks","data-validation","data-validation-library","databricks","date-engineering","dbt","duckdb","postgres","snowflake","sql","testing","testing-framework","testing-tool"],"created_at":"2026-04-04T02:01:33.675Z","updated_at":"2026-04-04T02:01:35.126Z","avatar_url":"https://github.com/LlucMH.png","language":null,"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/dbt-checks banner.png\" alt=\"dbt-checks banner\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/LlucMH/dbt-checks/ci.yml?branch=main\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/dbt-1.5%2B-orange\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/tested%20on-duckdb-blue\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/cross--db-dbt%20dispatch-lightgrey\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/LlucMH/dbt-checks\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/v/release/LlucMH/dbt-checks\" /\u003e\n\u003c/p\u003e\n\n---\n\n**`dbt-checks`** is a lightweight library of reusable data quality checks for dbt projects.\n\nIt provides simple, expressive tests to validate business rules and data integrity directly in your models — without writing custom SQL every time.\n\n\u003e ⚠️ Early-stage project — feedback and contributions are welcome.\n\n---\n\n# Installation\n\nAdd the package to your `packages.yml`:\n\n```yaml\npackages:\n  - git: https://github.com/LlucMH/dbt-checks.git\n    revision: v0.2.4\n```\n\nThen install dependencies:\n\n``` bash\ndbt deps\n```\n\n💡 Always pin a version in production projects.\n\n# Usage\n\nChecks can be added directly to models or columns in your schema files.\n\nExample:\n\n``` yaml\nmodels:\n  - name: orders\n    columns:\n      - name: value\n        data_tests:\n          - dbt_checks.non_negative\n          - dbt_checks.between_values:\n              arguments:\n                min_value: 0\n                max_value: 10000\n```\n\nRun tests as usual:\n\n``` bash\ndbt test\n```\n\n# Available Checks\n\ndbt-checks provides reusable data validation tests grouped by category.\n\n## Numeric\n\nNumeric checks validate numeric ranges and thresholds.\n\nCheck | Description\n----- | ----------\n`non_negative` | Ensures values are ≥ 0\n`non_positive` | Ensures values are ≤ 0\n`greater_than` | Ensures values are greater than a threshold\n`greater_or_equal_than` | Ensures values are ≥ a threshold\n`less_than` | Ensures values are less than a threshold\n`less_or_equal_than` | Ensures values are ≤ a threshold\n`between_values` | Ensures values fall within a numeric range\n\nExample\n\n``` yaml\ncolumns:\n  - name: value\n    data_tests:\n      - dbt_checks.between_values:\n          arguments:\n            min_value: 0\n            max_value: 100\n```\n## String\n\nString checks validate textual fields such as identifiers or formatted values.\n\nCheck | Description\n----- | ----------\n`not_blank` | Ensures strings are not empty or whitespace\n`length_between` | Validates string length range\n`matches_regex` | Validates a regex pattern\n`starts_with` | Ensures string starts with prefix\n`ends_with` | Ensures string ends with suffix\n`contains` | Ensures string contains substring\n\nExample\n\n``` yaml\ncolumns:\n  - name: email\n    data_tests:\n      - dbt_checks.matches_regex:\n          arguments:\n            pattern: \"^[^@]+@[^@]+\\\\.[^@]+$\"\n```\n## Temporal\n\nTemporal checks validate date and timestamp fields.\n\nCheck | Description\n----- | ----------\n`not_future_date` | Ensures date is not in the future\n`not_before_date` | Ensures date is after a minimum date\n`between_dates` | Ensures date is within a range\n`recent_date` | Ensures date is within N days\n`date_diff_less_than` | Ensures difference between two dates is within threshold\n`no_weekend_dates` | Ensures dates do not fall on weekends\n\nExample\n\n``` yaml\ncolumns:\n  - name: date\n    data_tests:\n      - dbt_checks.recent_date:\n          arguments:\n            max_age_days: 7\n```\n## Aggregation\n\nAggregation checks validate dataset-level metrics.\n\nCheck | Description\n----- | ----------\n`row_count_greater_than` | Ensures model has at least N rows\n`row_count_less_than` | Ensures model has at most N rows\n`row_count_between` | Ensures row count falls within range\n`sum_between` | Ensures column sum falls within range\n`avg_between` | Ensures column average falls within range\n`max_between` | Ensures column maximum falls within range\n`min_between` | Ensures column minimum falls within range\n\nExample\n\n``` yaml\nmodels:\n  - name: orders\n    data_tests:\n      - dbt_checks.row_count_greater_than:\n          arguments:\n            min_value: 100\n```\n## Ratio\n\nRatio checks validate proportions of rows matching a condition.\n\nCheck | Description\n----- | ----------\n`null_ratio_below` | Ensures null ratio is below threshold\n`null_ratio_between` | Ensures null ratio is within range\n`positive_ratio_between` | Ensures positive value ratio within range\n`negative_ratio_between` | Ensures negative value ratio within range\n`value_ratio_between` | Ensures specific value ratio within range\n\nExample\n\n``` yaml\ncolumns:\n  - name: email\n    data_tests:\n      - dbt_checks.null_ratio_below:\n          arguments:\n            threshold: 0.05\n```\n# Supported Warehouses\n\n`dbt-checks` is designed to work across common dbt adapters:\n\n-   Snowflake\n-   BigQuery\n-   Databricks\n-   Spark\n-   Redshift\n-   Postgres\n\nAdapter-specific behavior is handled through dbt's `dispatch` mechanism.\n\n**Tested on DuckDB in CI.**\n\n**Aditional adapters are supported through dbt dispatch (best-efort compatibility).**\n\n# Why dbt-checks?\n\nMany dbt projects repeatedly implement the same validation logic.\n\n`dbt-checks` provides:\n\n-   reusable checks\n-   simple configuration\n-   consistent validation patterns\n-   cross-warehouse compatibility\n\n# Contributing\n\nContributions are welcome.\n\nTo add a new check:\n\n1.  Implement it in `macros/tests`\n2.  Reuse helper macros when possible\n3.  Add documentation\n4.  Add integration tests\n\n# License\n\nThis project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllucmh%2Fdbt-checks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllucmh%2Fdbt-checks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllucmh%2Fdbt-checks/lists"}