Skip to main content
Version: 0.17.23

Checkpoint

class great_expectations.checkpoint.Checkpoint(name: str, data_context: AbstractDataContext, config_version: int | float = 1.0, template_name: str | None = None, run_name_template: str | 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, evaluation_parameters: dict | None = None, runtime_configuration: dict | None = None, validations: list[dict] | list[CheckpointValidationConfig] | None = None, profilers: list[dict] | None = None, ge_cloud_id: str | None = None, expectation_suite_ge_cloud_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 cCheckpoint name (e.g. “staging_tables”).

  • data_context – Data context that is associated with the current checkpoint.

  • config_version – Version number of the checkpoint configuration.

  • template_name – The name of another checkpoint to use as a base template.

  • run_name_template – A template to create run names, using environment variables and datetime-template syntax (e.g. “%Y-%M-staging-$MY_ENV_VAR”).

  • 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.

  • evaluation_parameters – Evaluation 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.

  • profilers – Profilers to use in generating this checkpoint.

  • validation_operator_name

    List of validation Operators configured by the Checkpoint.

    Deprecated since version 0.14.0.

  • batches

    List of Batches for validation by Checkpoint.

    Deprecated since version 0.14.0.

  • ge_cloud_id

    Great Expectations Cloud id for this Checkpoint.

    New in version 0.13.33: Used in cloud deployments.

  • expectation_suite_ge_cloud_id

    Great Expectations Cloud id associated with Expectation Suite.

    New in version 0.13.33: Used in cloud deployments.

  • 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(template_name: str | None = None, run_name_template: str | 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, evaluation_parameters: dict | None = None, runtime_configuration: dict | None = None, validations: list[dict] | list[CheckpointValidationConfig] | None = None, profilers: list[dict] | 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_ge_cloud_id: str | None = None) CheckpointResult#

Validate against current Checkpoint.

Arguments allow for override of the current Checkpoint configuration.

Parameters:
  • template_name – The name of another checkpoint to use as a base template.

  • run_name_template – A template to create run names, using environment variables and datetime-template syntax (e.g. “%Y-%M-staging-$MY_ENV_VAR”).

  • 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.

  • evaluation_parameters – Evaluation 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.

  • profilers – Profilers to use in generating this 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_ge_cloud_id

    Great Expectations Cloud id for the expectation suite

    New in version 0.13.33: Used in cloud deployments.

Returns:

CheckpointResult

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.