great_expectations.checkpoint.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¶
|
This is the base class for all actions that act on validation results |
|
This is the base class for all actions that act on validation results |
|
SlackNotificationAction sends a Slack notification to a given webhook. |
|
PagerdutyAlertAction sends a pagerduty event |
|
MicrosoftTeamsNotificationAction sends a Microsoft Teams notification to a given webhook. |
|
OpsgenieAlertAction creates and sends an Opsgenie alert |
|
EmailAction sends an email to a given list of email addresses. |
|
StoreValidationResultAction stores a validation result in the ValidationsStore. |
|
StoreEvaluationParametersAction extracts evaluation parameters from a validation result and stores them in the store |
|
StoreMetricsAction extracts metrics from a Validation Result and stores them |
|
UpdateDataDocsAction is a validation action that |
|
CloudNotificationAction is an action which utilizes the Cloud store backend |
-
great_expectations.checkpoint.actions.
pypd
¶
-
great_expectations.checkpoint.actions.
logger
¶
-
class
great_expectations.checkpoint.actions.
ValidationAction
(data_context)¶ 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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, expectation_suite_identifier=None, checkpoint_identifier=None, **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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
NoOpAction
(data_context)¶ Bases:
great_expectations.checkpoint.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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
SlackNotificationAction
(data_context, renderer, slack_webhook=None, slack_token=None, slack_channel=None, notify_on='all', notify_with=None)¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
SlackNotificationAction sends a Slack notification to a given webhook.
Configuration
- name: send_slack_notification_on_validation_result action: class_name: SlackNotificationAction # put the actual webhook URL in the uncommitted/config_variables.yml file # or pass in as environment variable # use slack_webhook when not using slack bot token slack_webhook: ${validation_notification_slack_webhook} # pass slack token and slack channel when not using slack_webhook slack_token: # token from slack app slack_channel: # slack channel that messages should go to notify_on: all # possible values: "all", "failure", "success" notify_with: # optional list of DataDocs site names to display in Slack message. Defaults to showing all 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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset=None, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
PagerdutyAlertAction
(data_context, api_key, routing_key, notify_on='failure')¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
PagerdutyAlertAction sends a pagerduty event
Configuration
- name: send_pagerduty_alert_on_validation_result action: class_name: PagerdutyAlertAction api_key: ${pagerduty_api_key} # Events API v2 key routing_key: # The 32 character Integration Key for an integration on a service or on a global ruleset. notify_on: failure # possible values: "all", "failure", "success"
-
_run
(self, validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset=None, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
MicrosoftTeamsNotificationAction
(data_context, renderer, microsoft_teams_webhook, notify_on='all')¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
MicrosoftTeamsNotificationAction sends a Microsoft Teams notification to a given webhook.
Configuration
- name: send_microsoft_teams_notification_on_validation_result action: class_name: MicrosoftTeamsNotificationAction # put the actual webhook URL in the uncommitted/config_variables.yml file # or pass in as environment variable microsoft_teams_webhook: ${validation_notification_microsoft_teams_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.microsoft_teams_renderer class_name: MicrosoftTeamsRenderer
-
_run
(self, validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset=None, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
OpsgenieAlertAction
(data_context, renderer, api_key, region=None, priority='P3', notify_on='failure')¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
OpsgenieAlertAction creates and sends an Opsgenie alert
Configuration
- name: send_opsgenie_alert_on_validation_result action: class_name: OpsgenieAlertAction # put the actual webhook URL in the uncommitted/config_variables.yml file # or pass in as environment variable api_key: ${opsgenie_api_key} # Opsgenie API key region: specifies the Opsgenie region. Populate 'EU' for Europe otherwise leave empty priority: specify the priority of the alert (P1 - P5) defaults to P3 notify_on: failure # possible values: "all", "failure", "success"
-
_run
(self, validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset=None, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
EmailAction
(data_context, renderer, smtp_address, smtp_port, sender_login, sender_password, receiver_emails, sender_alias=None, use_tls=None, use_ssl=None, notify_on='all', notify_with=None)¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
EmailAction sends an email to a given list of email addresses. Configuration .. code-block:: yaml
name: send_email_on_validation_result
- action:
class_name: EmailAction notify_on: all # possible values: “all”, “failure”, “success” notify_with: # optional list of DataDocs site names to display in the email message. Defaults to showing all 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.email_renderer class_name: EmailRenderer
# put the actual following information in the uncommitted/config_variables.yml file # or pass in as environment variable smtp_address: ${smtp_address} smtp_port: ${smtp_port} sender_login: ${email_address} sender_password: ${sender_password} sender_alias: ${sender_alias} # useful to send an email as an alias (default = sender_login) receiver_emails: ${receiver_emails} # string containing email addresses separated by commas use_tls: False use_ssl: True
-
_run
(self, validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset=None, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
class
great_expectations.checkpoint.actions.
StoreValidationResultAction
(data_context, target_store_name=None)¶ Bases:
great_expectations.checkpoint.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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
StoreEvaluationParametersAction
(data_context, target_store_name=None)¶ Bases:
great_expectations.checkpoint.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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
StoreMetricsAction
(data_context, requested_metrics, target_store_name='metrics_store')¶ Bases:
great_expectations.checkpoint.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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
-
class
great_expectations.checkpoint.actions.
UpdateDataDocsAction
(data_context, site_names=None, target_site_names=None)¶ Bases:
great_expectations.checkpoint.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 asite_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: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GeCloudIdentifier], data_asset, payload=None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-
class
great_expectations.checkpoint.actions.
CloudNotificationAction
(data_context: DataContext, checkpoint_ge_cloud_id: str)¶ Bases:
great_expectations.checkpoint.actions.ValidationAction
CloudNotificationAction is an action which utilizes the Cloud store backend to deliver user-specified Notification Actions.
-
_run
(self, validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: GeCloudIdentifier, data_asset=None, payload: Optional[Dict] = None, expectation_suite_identifier=None, checkpoint_identifier=None)¶
-