Validation Result
A Validation Result is an object generated when data is validated against an ExpectationA verifiable assertion about data. or Expectation SuiteA collection of verifiable assertions about data..
Validation Results can be saved for every time that a CheckpointThe primary means for validating data in a production deployment of Great Expectations. ValidatesThe act of applying an Expectation Suite to a Batch. data, permitting you to maintain records of your data's adherence to Expectations and track trends in the quality of the validated data. This can help you determine if failed Expectations are due to outliers in new data, or a more systemic problem. Validation Results are also among the information passed to ActionsA Python class with a run method that takes a Validation Result and does something with it when a Checkpoint is run. This allows them to be used for any purpose that an Action can be created to handle. Examples of this might be sending a Slack or email notification if the Validation fails, only launching a secondary process if the Validation Results report that Validation passed, or updating your Data Docs with specific information pulled from the Validation Results.
Relationship to other objects
Validation Results are generated by a Checkpoint when
a
ValidatorUsed to run an Expectation Suite against
data.
runs an Expectation Suite against its paired
Batch RequestProvided to a Datasource in order to create a
Batch.. The Validation Result will be passed to the
Checkpoint's action_list
where it
will be available to any Actions that may need it. The
StoreValidationResultAction
subclass of
ValidationAction
will save Validation
Results to the
Validation Result StoreA connector to store and retrieve information
about objects generated when data is Validated
against an Expectation Suite.
if it is present in a Checkpoint's
action_list
.
Use cases
A Validation Result is generated when you use
the interactive workflow to create Expectations
and the newly created Expectation is run against the
sample
BatchA selection of records from a Data Asset.
of data you are working with. These individual
Validation Results will be created as
ExpectationValidationResult
instances.
Validation Results are generated when you run
Checkpoints to Validate data. Because Checkpoints
operate on Expectation Suites rather than individual
Expectations, the Validation Results generated by
Checkpoints will be created as
ExpectationSuiteValidationResult
instances. The difference between an
ExpectationValidationResult
instance and
an
ExpectationSuiteValidationResult
instance
is much like the difference between an Expectation and
an Expectation Suite: One contains more of the other,
along with some additional metadata.
Specifically, an
ExpectationSuiteValidationResult
will
contain additional information pertaining to the
Expectation Suite that was Validated, and will contain
the data of an
ExpectationValidationResult
for each
Expectation in the Expectation Suite. These
ExpectationValidationResult
instances
will be in a list accessed by the
results
attribute of the
ExpectationSuiteValidationResult
instance.
The Validation Results generated as
ExpectationSuiteValidationResult
instances can be saved in JSON format in a Validation
Result Store, and rendered in
Data DocsHuman readable documentation generated from Great
Expectations metadata detailing Expectations,
Validation Results, etc.. Both of these activities are handled by Actions in
the Checkpoint's action_list
. In
most cases, when you see "Validation
Results" in Great Expectations, it will be in
reference to the output generated as an
ExpectationSuiteValidationResult
when a
Checkpoint is run.
Access
Inside of Actions, Validation Results are a parameter
that is passed to the Action when it is run. The other
place where you can access your Validation Results is
in your Validation Result Store. In both of these
cases, you will be working with an
ExpectationSuiteValidationResult
instance, or the serialization of such an instance
into a JSON file.
Outside of Actions and your Validation Result Store,
you will generally only encounter Validation Results
when validating a single expectation against some
sample data in the interactive workflow for creating
Expectations. When an individual Validation Result is
generated, it is generated as an
ExpectationValidationResult
instance.
Create
Validation Results are created automatically when data is Validated in Great Expectations. You will not need to manually create them; they are a product of the Validation process.
A single Validation Result is created when an
Expectation is created with the interactive workflow
and the newly created Expectation validates itself
against the sample data that is used in that process.
This is generated as an
ExpectationValidationResult
object.
A Validation Result is also created for each
Expectation in an Expectation Suite when a Checkpoint
is run. These are generated as values in the
results
list of an
ExpectationSuiteValidationResult
object.
Configure Expectation Validation results
ExpectationValidationResult
instances
represent the Validation Result of a single
Expectation. If you are accessing the instance itself
(rather than the serialized JSON of an instance found
in your Validation Results Store) you will find that
the instance provides information about the
Expectation and the outcome of its Validation through
the following attributes:
-
success: A
true
orfalse
indicator of whether the Expectation passed. - expectation_config: The config used by the Expectation, including such things as type of Expectation and key word arguments that were passed to the Expectation.
- result: The observed values generated when the Expectation was run.
- meta: Provides additional information about the Validation Result of some Expectations.
-
exception_info: This is a
dictionary with three keys.
-
raised_exception
indicates if an exception was raised during the Validation. -
exception_traceback
contains the traceback of the raised exception, if an exception was raised. -
exception_message
contains the message associated with the raised exception, if an exception was raised.
-
Configure Expectation Suite Validation results
ExpectationSuiteValidationResult
instances are generated when an Expectation Suite is
validated. These instances contain a list of
Validation Results for individual Expectations in the
Expectation Suite, as well as some additional
information. This information can be accessed through
the following attributes:
-
success: A
true
orfalse
indicator of whether all the Expectations in the Expectation Suite passed. - evaluation_parameters: The Evaluation Parameters and their values at the time when the Expectation Suite was Validated.
-
results: A list of
ExpectationValidationResult
results for each Expectation in the Expectation Suite. - meta: Additional information about the Validation Results, such as the name of the Expectation Suite that was run, information about the Batch that was Validated, when the Validation took place, and what version of Great Expectations was used to run the Validation.
-
statistics: Some statistics to
summarize the
results
list, including things like the number of evaluated Expectations and the percentage of those Expectations that passed successfully.
The attributes described above for
ExpectationValidationResult
and
ExpectationSuiteValidationResult
also
correspond to the keys that you will find in the
serialized JSON that is created when Validation
Results in the form of an
ExpectationSuiteValidationResult
instance
are saved to the Validation Results Store.