Skip to main content
Version: 1.2.3

SlackNotificationAction

class great_expectations.checkpoint.SlackNotificationAction(*, type: Literal['slack'] = 'slack', name: str, slack_webhook: Optional[Union[great_expectations.datasource.fluent.config_str.ConfigStr, str]] = None, slack_token: Optional[Union[great_expectations.datasource.fluent.config_str.ConfigStr, str]] = None, slack_channel: Optional[Union[great_expectations.datasource.fluent.config_str.ConfigStr, str]] = None, notify_on: Literal['all', 'failure', 'success'] = 'all', notify_with: Optional[List[str]] = None, show_failed_expectations: bool = False, renderer: great_expectations.render.renderer.slack_renderer.SlackRenderer = None)#

Sends a Slack notification to a given webhook.

- 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}
slack_token:
slack_channel:
notify_on: all
notify_with:
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
show_failed_expectations: True

Parameters

renderer – Specifies the Renderer used to generate a query consumable by Slack API, e.g.:

                  {
"module_name": "great_expectations.render.renderer.slack_renderer",
"class_name": "SlackRenderer",
}

:param slack_webhook: The incoming Slack webhook to which to send notification. :param slack_token: Token from Slack app. Used when not using slack_webhook. :param slack_channel: Slack channel to receive notification. Used when not using slack_webhook. :param notify_on: Specifies validation status that triggers notification. One of "all", "failure", "success". :param notify_with: List of DataDocs site names to display in Slack messages. Defaults to all. :param show_failed_expectations: Shows a list of failed expectation types.