Checkpoint
class great_expectations.checkpoint.Checkpoint(name: str, data_context: AbstractDataContext | None = None, expectation_suite_name: str | None = None, batch_request: BatchRequestBase | FluentBatchRequest | dict | None = None, validator: Validator | None = None, action_list: Sequence[ActionDict] | None = None, suite_parameters: dict | None = None, runtime_configuration: dict | None = None, validations: list[dict] | list[CheckpointValidationDefinition] | None = None, id: str | None = None, expectation_suite_id: str | None = None, default_validation_id: str | None = None)#
A checkpoint is the primary means for validating data in a production deployment of Great Expectations.
Checkpoints provide a convenient abstraction for bundling the Validation of a Batch (or Batches) of data against an Expectation Suite (or several), as well as the Actions that should be taken after the validation.
A Checkpoint uses a Validator to run one or more Expectation Suites against one or more Batches provided by one or more Batch Requests. Running a Checkpoint produces Validation Results and will result in optional Actions being performed if they are configured to do so.
- Parameters:
name – User-selected checkpoint name (e.g. “staging_tables”).
data_context – Data context that is associated with the current checkpoint.
expectation_suite_name – Expectation suite associated with checkpoint.
batch_request – Batch request describing the batch of data to validate.
action_list – A list of actions to perform after each batch is validated.
suite_parameters – Suite parameters to use in generating this checkpoint.
runtime_configuration – Runtime configuration to pass into the validator’s runtime configuration (e.g. result_format).
validations – Validations to be executed as part of checkpoint.
id – Great Expectations Cloud id for this Checkpoint.
expectation_suite_id – Great Expectations Cloud id associated with Expectation Suite.
default_validation_id – Default value used by Checkpoint if no Validations are configured.
- Raises:
ValueError – If BatchRequest contains batch_data, since only primitive types are allowed in the constructor.
ValueError – If Validations contains batch_data, since only primitive types are allowed in the constructor.
run(expectation_suite_name: str | None = None, batch_request: BatchRequestBase | FluentBatchRequest | dict | None = None, validator: Validator | None = None, action_list: Sequence[ActionDict] | None = None, suite_parameters: dict | None = None, runtime_configuration: dict | None = None, validations: list[dict] | list[CheckpointValidationDefinition] | None = None, run_id: str | RunIdentifier | None = None, run_name: str | None = None, run_time: datetime.datetime | None = None, result_format: str | dict | None = None, expectation_suite_id: str | None = None) CheckpointResult #
Validate against current Checkpoint.
Arguments allow for override of the current Checkpoint configuration.
- Parameters:
expectation_suite_name – Expectation suite associated with checkpoint.
batch_request – Batch request describing the batch of data to validate.
validator – Validator objects, loaded with Batch data samples, can be supplied (in lieu of “batch_request”)
action_list – A list of actions to perform after each batch is validated.
suite_parameters – Suite parameters to use in generating this checkpoint.
runtime_configuration – Runtime configuration to pass into the validator’s runtime configuration (e.g. result_format).
validations – Validations to be executed as part of checkpoint.
run_id – The run_id for the validation; if None, a default value will be used.
run_name – The run_name for the validation; if None, a default value will be used.
run_time – The date/time of the run.
result_format – One of several supported formatting directives for expectation validation results
expectation_suite_id – Great Expectations Cloud id for the expectation suite
- Raises:
InvalidCheckpointConfigError – If run_id is provided with run_name or run_time.
InvalidCheckpointConfigError – If result_format is not an expected type.
CheckpointError – If Checkpoint does not contain a batch_request or validations.
- Returns:
CheckpointResult