Skip to main content
Version: 1.3.12

ValidationDefinition

Signature

class great_expectations.ValidationDefinition(
*,
name: str,
data: great_expectations.core.batch_definition.BatchDefinition,
suite: great_expectations.core.expectation_suite.ExpectationSuite,
id: Optional[str] = None
)

Responsible for running a suite against data and returning a validation result.

Parameters

NameDescription

name

The name of the validation.

data

A batch definition to validate.

suite

A grouping of expectations to validate against the data.

id

A unique identifier for the validation; added when persisted with a store.

Properties

NameDescriptionReference

asset

The parent Data Asset of the Batch Definition.

DataAsset

batch_definition

The Batch Definition to validate.

BatchDefinition

Methods

run

Signature

run(
*,
checkpoint_id: Optional[str] = None,
batch_parameters: Optional[BatchParameters] = None,
expectation_parameters: Optional[SuiteParameterDict] = None,
result_format: ResultFormatUnion = ResultFormat.SUMMARY,
run_id: RunIdentifier | None = None
) → ExpectationSuiteValidationResult

Runs a validation using the configured data and suite.

Parameters

NameDescription

batch_parameters

The dictionary of parameters necessary for selecting the correct batch to run the validation on. The keys are strings that are determined by the BatchDefinition used to instantiate this ValidationDefinition. For example:

  • whole table -> None
  • yearly -> year
  • monthly -> year, month
  • daily -> year, month, day

expectation_parameters

A dictionary of parameters values for any expectations using parameterized values (the $PARAMETER syntax). The keys are the parameter names and the values are the values to be used for this validation run.

result_format

A parameter controlling how much diagnostic information the result contains.

checkpoint_id

This is used by the checkpoints code when it runs a validation definition. Otherwise, it should be None.

run_id

An identifier for this run. Typically, this should be set to None and it will be generated by this call.

save

Signature

save()None

Save the current state of this ValidationDefinition.