Skip to main content

Validations

Validations are rules created using SQL queries that check whether your queries are operating as expected. They are a powerful features to solve upstream issues that you might not have otherwise uncovered until it is too late.

In the editor of model select the Validations tab. Validations can only be added or edited if the validations model is in edit mode and assigned to the you.

Validations Bar

Create a Validation#

To create a new validation select the add VALIDATION button. A window will appear with

Validations Editor

The following sections are available to fill in:

Name#

Select a name for your validation. There are a few rules to creating a name:

  • No more than 32 characters long
  • Use lowercase letters
  • Use numbers but not as the first character
  • Include underscores (ie. snake_case)

Description#

A description of your validation.

Template#

Select a template to use for building a validation. This is optional.

SQL Editor#

Here is where you write or edit the SQL query that defines the validation. The statement should validate a rule that is true or not.

GOLDEN RULE

If the SQL statement is true the validation will pass and so will the model. If the validation is false it will fail along with the model and pipeline and none of the dependent models will run either.

Example#

An example of a validation is to ensure that the table is not empty.

Using the following SQL query will check whether the statement is true or not:

SELECT COUNT(*)>0FROM {{this}}

Saving the validation make it run the next time the model is run. You may add as many validations as you like by using the add VALIDATION button.

Monitoring the Validated Model#

Navigate to the Monitoring section and select the pipeline and model task the validation is applied to. In the drop down section in the validations task the validation runs will appear once the model task has completed.

The following information is available:

Validation Name#

The name of the validation.

Success#

True if the statement succeeded or False if it failed.

Error#

If there is in error with running the validation (ie. the SQL statement failed to run) the error will display here.

Created At#

The timestamp that the validation run started.

Validations Monitoring False

Validations Monitoring True

Delete a Validation#

To remove a validation from a model simply tick off the delete check box and click save.

Delete Validations Check Box