Overview of dbt-utils Generic Tests
mainThe dbt-utils package provides a suite of generic tests that can be applied to models and columns in your dbt project. These tests allow you to validate data quality using reusable logic. Available generic tests include:
equal_rowcount: Compares row counts between relations.fewer_rows_than: Ensures a relation has fewer rows than a specified threshold.equality: Compares columns or entire tables for equality, with options to compare specific columns or ignore certain ones.expression_is_true: Validates that a specific expression evaluates to true for all rows.recency: Checks if data is recent based on a timestamp column.at_least_one: Ensures at least one value in a set meets a condition.not_constant: Checks that a column is not composed of a single constant value.not_empty_string: Ensures columns do not contain empty strings.cardinality_equality: Compares the cardinality of different sets.not_null_proportion: Validates the proportion of non-null values.not_accepted_values: An alternative to standard accepted values tests.relationships_where: Validates relationships with additional filtering logic.mutually_exclusive_ranges: Ensures values do not fall into overlapping ranges.sequential_values: Checks for sequential ordering of values.unique_combination_of_columns: Validates uniqueness across a combination of columns.accepted_range: Ensures values fall within a specific range.