Skip to main content
Version: 0.14.13

How to validate data by running a Checkpoint

This guide will help you ValidateThe act of applying an Expectation Suite to a Batch. your data by running a CheckpointThe primary means for validating data in a production deployment of Great Expectations..

As stated in the Getting Started Tutorial Step 4: Validate data, the best way to Validate data in production with Great Expectations is using a CheckpointThe primary means for validating data in a production deployment of Great Expectations.. The advantage of using a Checkpoint is ease of use, due to its principal capability of combining the existing configuration in order to set up and perform the Validation:

  • Expectation SuitesA collection of verifiable assertions about data.
  • Data ConnectorsProvides the configuration details based on the source data system which are needed by a Datasource to define Data Assets.
  • Batch RequestsProvided to a Datasource in order to create a Batch.
  • ActionsA Python class with a run method that takes a Validation Result and does something with it

Otherwise, configuring these validation parameters would have to be done via the API. A Checkpoint encapsulates this "boilerplate" and ensures that all components work in harmony together. Finally, running a configured Checkpoint is a one-liner, as described below.

Prerequisites: This how-to guide assumes you have:

You can run the Checkpoint from the CLICommand Line Interface in a Terminal shell or using Python.

Steps

1. Run your Checkpoint

Checkpoints can be run like applications from the command line by running:

great_expectations checkpoint run my_checkpoint
Validation failed!

2. Observe the output

The output of your validation will tell you if all validations passed or if any failed.

Additional notes

This command will return posix status codes and print messages as follows:

+-------------------------------+-----------------+-----------------------+
| **Situation** | **Return code** | **Message** |
+-------------------------------+-----------------+-----------------------+
| all validations passed | 0 | Validation succeeded! |
+-------------------------------+-----------------+-----------------------+
| one or more validation failed | 1 | Validation failed! |
+-------------------------------+-----------------+-----------------------+