great_expectations.validation_operators.actions

An action is a way to take an arbitrary method and make it configurable and runnable within a Data Context.

The only requirement from an action is for it to have a take_action method.

Module Contents

Classes

ValidationAction(data_context)

This is the base class for all actions that act on validation results

NoOpAction(data_context)

This is the base class for all actions that act on validation results

SlackNotificationAction(data_context, renderer, slack_webhook, notify_on=’all’)

SlackNotificationAction sends a Slack notification to a given webhook.

StoreValidationResultAction(data_context, target_store_name=None)

StoreValidationResultAction stores a validation result in the ValidationsStore.

StoreEvaluationParametersAction(data_context, target_store_name=None)

StoreEvaluationParametersAction extracts evaluation parameters from a validation result and stores them in the store

StoreMetricsAction(data_context, requested_metrics, target_store_name=’metrics_store’)

StoreMetricsAction extracts metrics from a Validation Result and stores them

UpdateDataDocsAction(data_context, site_names=None, target_site_names=None)

UpdateDataDocsAction is a validation action that

great_expectations.validation_operators.actions.logger
class great_expectations.validation_operators.actions.ValidationAction(data_context)

Bases: object

This is the base class for all actions that act on validation results and are aware of a Data Context namespace structure.

The Data Context is passed to this class in its constructor.

run(self, validation_result_suite, validation_result_suite_identifier, data_asset, **kwargs)
Parameters
  • validation_result_suite

  • validation_result_suite_identifier

  • data_asset

Param

kwargs - any additional arguments the child might use

Returns

_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)
class great_expectations.validation_operators.actions.NoOpAction(data_context)

Bases: great_expectations.validation_operators.actions.ValidationAction

This is the base class for all actions that act on validation results and are aware of a Data Context namespace structure.

The Data Context is passed to this class in its constructor.

_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)
class great_expectations.validation_operators.actions.SlackNotificationAction(data_context, renderer, slack_webhook, notify_on='all')

Bases: great_expectations.validation_operators.actions.ValidationAction

SlackNotificationAction sends a Slack notification to a given webhook.

Configuration

- name: send_slack_notification_on_validation_result
action:
  class_name: StoreValidationResultAction
  # put the actual webhook URL in the uncommitted/config_variables.yml file
  slack_webhook: ${validation_notification_slack_webhook}
  notify_on: all # possible values: "all", "failure", "success"
  renderer:
    # the class that implements the message to be sent
    # this is the default implementation, but you can
    # implement a custom one
    module_name: great_expectations.render.renderer.slack_renderer
    class_name: SlackRenderer
_run(self, validation_result_suite, validation_result_suite_identifier, data_asset=None)
class great_expectations.validation_operators.actions.StoreValidationResultAction(data_context, target_store_name=None)

Bases: great_expectations.validation_operators.actions.ValidationAction

StoreValidationResultAction stores a validation result in the ValidationsStore.

Configuration

- name: store_validation_result
action:
  class_name: StoreValidationResultAction
  # name of the store where the actions will store validation results
  # the name must refer to a store that is configured in the great_expectations.yml file
  target_store_name: validations_store
_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)
class great_expectations.validation_operators.actions.StoreEvaluationParametersAction(data_context, target_store_name=None)

Bases: great_expectations.validation_operators.actions.ValidationAction

StoreEvaluationParametersAction extracts evaluation parameters from a validation result and stores them in the store configured for this action.

Evaluation parameters allow expectations to refer to statistics/metrics computed in the process of validating other prior expectations.

Configuration

- name: store_evaluation_params
action:
  class_name: StoreEvaluationParametersAction
  # name of the store where the action will store the parameters
  # the name must refer to a store that is configured in the great_expectations.yml file
  target_store_name: evaluation_parameter_store
_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)
class great_expectations.validation_operators.actions.StoreMetricsAction(data_context, requested_metrics, target_store_name='metrics_store')

Bases: great_expectations.validation_operators.actions.ValidationAction

StoreMetricsAction extracts metrics from a Validation Result and stores them in a metrics store.

Configuration

- name: store_evaluation_params
action:
  class_name: StoreMetricsAction
  # name of the store where the action will store the metrics
  # the name must refer to a store that is configured in the great_expectations.yml file
  target_store_name: my_metrics_store
_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)
class great_expectations.validation_operators.actions.UpdateDataDocsAction(data_context, site_names=None, target_site_names=None)

Bases: great_expectations.validation_operators.actions.ValidationAction

UpdateDataDocsAction is a validation action that notifies the site builders of all the data docs sites of the Data Context that a validation result should be added to the data docs.

Configuration

- name: update_data_docs
action:
  class_name: UpdateDataDocsAction

You can also instruct UpdateDataDocsAction to build only certain sites by providing a site_names key with a list of sites to update:

  • name: update_data_docs

action:

class_name: UpdateDataDocsAction site_names:

  • production_site

_run(self, validation_result_suite, validation_result_suite_identifier, data_asset)