Tests in the YAML Config
Here you can see all the supported tests definitions and how to configure them in the YAML config file. A Test Definition is a generic definition of a test. This Test Definition then gets specified in a Test Case. This Test Case is where the parameter(s) of a Test Definition are specified. In this section, you will learn what tests we currently support and how to configure them in the YAML/JSON config file.Table Tests
Tests applied on top of a Table. Here is the list of all table tests:- Table Row Count to Equal
- Table Row Count to be Between
- Table Column Count to Equal
- Table Column Count to be Between
- Table Column Name to Exist
- Table Column to Match Set
- Table Custom SQL Test
- Table Row Inserted Count To Be Between
- Compare 2 Tables for Differences
- Table Data to Be Fresh [Collate]
Table Row Count to Equal
Validate the total row count in the table is equal to the given value. Dimension: Integrity Properties:value: Expected number of rows.
YAML Config
Table Row Count to be Between
Validate the total row count is within a given range of values. Dimension: Integrity Properties:minValue: Lower bound of the interval. If informed, the number of rows should be bigger than this number.maxValue: Upper bound of the interval. If informed, the number of rows should be lower than this number.
YAML Config
Table Column Count to Equal
Validate that the number of columns in a table is equal to a given value. Dimension: Integrity PropertiescolumnCount: Expected number of columns.
YAML Config
Table Column Count to be Between
Validate the number of columns in a table is between the given value Dimension: Integrity PropertiesminColValue: lower boundmaxColValue: upper bound
YAML Config
Table Column Name to Exist
Validate a column name is present in the table Dimension: Integrity PropertiescolumnName: the name of the column to check for
YAML Config
Table Column to Match Set
Validate a list of table column name matches an expected set of columns Dimension: Integrity PropertiescolumnNames: comma separated string of column nameordered: whether the test should check for column ordering. Default to False
YAML Config
Table Custom SQL Test
Write you own SQL test. When writing your query you can use 2 strategies:ROWS(default): expects the query to be written asSELECT <field>, <field> FROM <foo> WHERE <condition>. Note if your query returns a large amount of rows it might cause an “Out Of Memory” error. In this case we recommend you to use theCOUNTstrategy.COUNT: expects the query to be written asSELECT COUNT(<field>) FROM <foo> WHERE <condition>.
sqlExpression: SQL expressionstrategy: one ofROWSorCOUNTthreshold: an integer defining the threshold above which the test should fail (default to 0 if not specified)
Example
Table Row Inserted Count To Be Between
Validate the number of rows inserted for the defined period is between the expected range Dimension: Integrity PropertiesMin Row Count: Lower boundMax Row Count: Upper boundColumn Name: The name of the column used to apply the range filterRange Type: One ofHOUR,DAY,MONTH,YEARInterval: The range interval (e.g. 1,2,3,4,5, etc)
YAML Config
Compare 2 Tables for Differences
Compare two tables for differences, letting you check for integrity across different services — for example, a table in Snowflake against a table in Redshift.Only the connectors listed below are currently supported by the underlying
data-diff
library. Using an unsupported connector will result in a Scheme '...' currently not supported error.- Snowflake
- BigQuery
- Athena
- Redshift
- Postgres
- MySQL
- MSSQL
- Oracle
- Trino
keyColumns: The key column to use as the key for the comparison. Resolves to the primary key (if defined) if not setuseColumns: The columns against which the comparison will done. If not provided it will use all the columnstable2: The table against which the comparison will be done. Must be the fully qualified name as defined in Collatethreshold: The threshold of different rows above which the test should fail — default to 0where: Anywhereclause to passcaseSensitiveColumns: Whether the column comparison should be case sensitive or not. Default tofalse.
YAML Config
Table Data to Be Fresh [Collate]
Validate the freshness of a table’s data. Dimension: Accuracy Propertiescolumn: the column that will be used to check the table freshnesstimeSinceUpdate: (in seconds) The data is expected to be updated within this number of seconds. If the time since the last update is greater than this value, the test will fail.
YAML Config
Column Tests
Tests applied on top of Column metrics. Here is the list of all column tests:- Column Values to Be Unique
- Column Values to Be Not Null
- Column Values to Match Regex
- Column Values to not Match Regex
- Column Values to Be in Set
- Column Values to Be Not In Set
- Column Values to Be Between
- Column Values Missing Count to Be Equal
- Column Values Lengths to Be Between
- Column Value Max to Be Between
- Column Value Min to Be Between
- Column Value Mean to Be Between
- Column Value Median to Be Between
- Column Values Sum to Be Between
- Column Values Standard Deviation to Be Between
- Column Values To Be At Expected Location
Column Values to Be Unique
Makes sure that there are no duplicate values in a given column. Dimension: Uniqueness Behavior
Properties
columnValuesToBeUnique: To be set astrue. This is required for proper JSON parsing in the profiler module.
Column Values to Be Not Null
Validates that there are no null values in the column. Dimension: Completeness PropertiescolumnValuesToBeNotNull: To be set astrue. This is required for proper JSON parsing in the profiler module.
YAML Config
Column Values to Match Regex
This test allows us to specify how many values in a column we expect that will match a certain regex expression. Please note that for certain databases we will fall back to SQLLIKE expression. The databases supporting regex pattern as of 0.13.2 are:
- redshift
- postgres
- oracle
- mysql
- mariaDB
- sqlite
- clickhouse
- snowflake
LIKE expression
Dimension:
Validity
Properties
regex: expression to match a regex pattern. E.g.,[a-zA-Z0-9]{5}.
YAML Config
Column Values to not Match Regex
This test allows us to specify values in a column we expect that will not match a certain regex expression. If the test find values matching theforbiddenRegex the test will fail. Please note that for certain databases we will fall back to SQL LIKE expression. The databases supporting regex pattern as of 0.13.2 are:
- redshift
- postgres
- oracle
- mysql
- mariaDB
- sqlite
- clickhouse
- snowflake
LIKE expression
Dimension:
Validity
Properties
regex: expression to match a regex pattern. E.g.,[a-zA-Z0-9]{5}.
YAML Config
Column Values to Be in Set
Validate values form a set are present in a column. Dimension: Validity PropertiesallowedValues: List of allowed strings or numbers.
YAML Config
Column Values to Be Not In Set
Validate that there are no values in a column in a set of forbidden values. Dimension: Validity PropertiesforbiddenValues: List of forbidden strings or numbers.
YAML Config
Column Values to Be Between
Validate that the values of a column are within a given range.Only supports numerical types.Dimension: Accuracy Properties
minValue: Lower bound of the interval. If informed, the column values should be bigger than this number.maxValue: Upper bound of the interval. If informed, the column values should be lower than this number.
YAML Config
Column Values Missing Count to Be Equal
Validates that the number of missing values matches a given number. Missing values are the sum of nulls, plus the sum of values in a given list which we need to consider as missing data. A clear example of that would beNA or N/A.
Dimension:
Completeness
Properties
missingCountValue: The number of missing values needs to be equal to this. This field is mandatory.missingValueMatch(Optional): A list of strings to consider as missing values.
YAML Config
Column Values Lengths to Be Between
Validates that the lengths of the strings in a column are within a given range.Only supports concatenable types.Dimension: Accuracy Properties
minLength: Lower bound of the interval. If informed, the string length should be bigger than this number.maxLength: Upper bound of the interval. If informed, the string length should be lower than this number.
YAML Config
Column Value Max to Be Between
Validate the maximum value of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForMaxInCol: lower boundmaxValueForMaxInCol: upper bound
YAML Config
Column Value Min to Be Between
Validate the minimum value of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForMinInCol: lower boundmaxValueForMinInCol: upper bound
YAML Config
Column Value Mean to Be Between
Validate the mean of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForMeanInCol: lower boundmaxValueForMeanInCol: upper bound
YAML Config
Column Value Median to Be Between
Validate the median of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForMedianInCol: lower boundmaxValueForMedianInCol: upper bound
YAML Config
Column Values Sum to Be Between
Validate the sum of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForColSum: lower boundmaxValueForColSum: upper bound
YAML Config
Column Values Standard Deviation to Be Between
Validate the standard deviation of a column is between a specific rangeOnly supports numerical types.Dimension: Accuracy Properties
minValueForStdDevInCol: lower boundminValueForStdDevInCol: upper bound
YAML Config
Column Values To Be At Expected Location
Validate the reference value for a column is a the expected geographic locationData will be temporarily stored in memory while the test case is running to validate the location. Not data will be permanently stored. France is the only supported location at this time. To add any additional location please reach out to the team in our slack support channelDimension: Accuracy Properties
locationReferenceType: the type of location referenceCITYorPOSTAL_CODElongitudeColumnName: longitude column namelatitudeColumnName: latitude column nameradius: radius in meter from which the location can be from the expected lat/long — acts as a buffer
YAML Config