equal_rowcount(compare_model, group_by_columns) (view source) |
This test compares two models or tables and asserts they have the same number of rows. |
fewer_rows_than(compare_model, group_by_columns)
(view source) |
This test asserts that a specific model or table has fewer rows than a specified threshold or compared to another table.
|
equality(compare_model, compare_columns, group_by_columns) (view source) |
This test compares two models or tables and asserts their equality. You can specify a subset of columns to compare.
|
expression_is_true(expression, where)
(view source) |
The test ensures that a given SQL expression holds true for every record, which is particularly helpful in maintaining column integrity. For instance, this can be used to confirm results from simple algebraic operations between columns, validate the length of a column, or assess the truth value of a column. Note: Use the where clause to check a subset of records. |
recency(datepart, field, interval, group_by_columns) (view source) |
This test ensures the timestamp column in the given model has data that's newer than a specific date range.
|
at_least_one(group_by_columns) (view source) |
This test checks a specified column and asserts it has at least one value.
|
not_constant(group_by_columns) (view source) |
This test makes sure a column doesn't have the same value for every row.
|
not_empty_string(trim_whitespace=true) (view source) |
This test asserts that none of the values are equal to an empty string. The optional argument, trim_whitespace will remove whitespace from the column.
|
cardinality_equality(field, to) (view source) |
This test asserts that a specific column has the same number of unique values as another column in a different table.
|
not_null_proportion(at_least, at_most=1.0, group_by_columns)
(view source) |
This test checks that a column has non-empty values within a certain range. If you don't specify an upper limit, it assumes up to 100% (or 1.0) of the values can be non-empty. |
not_accepted_values(values)
(view source) |
This test checks that there aren't any rows with the specified values. |
relationships_where(to, field, from_condition, to_condition)
(view source) |
This test checks the connection between two models, similar to the basic relationship checks. It also allows for filtering out specific rows, like test entries or recent entries, which might have temporary inconsistencies because of data processing limits.
|
mutually_exclusive_ranges(lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) (view source) |
By setting the ‘lower_bound_column’ and ‘upper_bound_column’ ranges, This test asserts that the ranges don't overlap with those of other rows. |
sequential_values(interval=1, datepart=None, group_by_columns)
(view source) |
This test checks that a column has values in order, either numbers or dates |
unique_combination_of_columns(combination_of_columns, quote_columns=false)
(view source) |
This test ensures that when certain columns are combined, their values are unique. For instance, while a month or a product alone might repeat, the pairing of a month with a product is always distinct.
|
accepted_range(min_value, max_value, where, Inclusive=true)
(view source) |
This test ensures a column's values are within a certain range, set by a minimum and maximum value. You can choose if the range includes or excludes the boundary values. If needed, you can also focus on specific records with a filter. As long as the data type can be compared using > or < signs, you can use this test.
|
| Grouping in tests |
Some tests offer an extra group_by_columns option to get more detailed checks. Arg for group_by_column must be in list format. Tests that support this include: equal_rowcount, fewer_rows_than, recency, at_least_one, not_constant, sequential_values, non_null_proportion. |