Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

AlphaFounders/gemma-dbt-utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gemma-dbt-utils

Gemma Analytics utilities for dbt

This packages is expected to be used in addition to dbt-utils and expands upon it rather than replacing it.

TBU

  • Licence
  • Properly implement integration tests

Schema Tests

numeric_constraints (source)

This schema test asserts that a column of numerical value is within specified bounds.

Usage:

version: 2
models:
  - name: model_name
    columns:
      - name: a_number
        tests:
          - gemma_dbt_utils.numeric_constraints:
              gte: 0
              lt: 180

Possible options:

eq:   equal
ne:   not equal
gt:   greater than
gte:  greater than or equal
lt:   lower than
lte:  lower than or equal

The macro accepts an optional parameter condition that allows for asserting the expression on a subset of all records.

Usage:

version: 2
models:
  - name: model_name
    columns:
      - name: a_number
        tests:
          - gemma_dbt_utils.numeric_constraints:
              eq: 1
              condition: "status = 'success'"

unique_where (source)

This schema test is a variant of the unique test that applies a where condition. Useful whenever you need to validate a join on some form of id that is not unique per se, but should be unique in combination with a second condition.

Usage:

version: 2
models:
  - name: model_name
    columns:
      - name: col_a
        tests:
          - gemma_dbt_utils.unique_where:
              where: "col_b = 5"

About

Gemma Analytics utilities for dbt

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PLpgSQL 72.0%
  • Shell 28.0%