Slack

This module requires an optional dependency. See Installation for details.

Slack Notifications

Tasks related to creation of Slack notifications

tamr_toolbox.notifications.slack.send_message(*, slack_client, channel, message, raise_error=True, **kwargs)[source]

Sends a message to a pre-defined Slack channel

Parameters
  • slack_client (WebClient) – A Slack WebClient

  • channel (str) – A (public) Slack channel to receive messages

  • message (str) – A message to be sent to a Slack channel

  • raise_error (bool) – A boolean value to opt out raising Slack API errors

Return type

Dict[str, Any]

Returns

The data property of the Slack WebClient object

Raises

SlackApiError – if the SlackClient does not post the message correctly and raise_error is set to True

tamr_toolbox.notifications.slack.monitor_job(tamr, *, slack_client, channel, operation, poll_interval_seconds=1, timeout_seconds=None, notify_states=None)[source]

Monitors a Tamr Operation and sends a Slack message to a channel when the job status is updated

Parameters
  • tamr (Client) – A Tamr client

  • slack_client (WebClient) – A Slack WebClient

  • channel (str) – A (public) Slack channel to receive messages

  • operation (Union[int, str, Operation]) – A job ID or a Tamr operation

  • poll_interval_seconds (float) – Time interval (in seconds) between subsequent polls

  • timeout_seconds (Optional[float]) – Time (in seconds) to wait

  • notify_states (Optional[List[OperationState]]) – States for which notifications should be sent, use None for all states

Return type

List[Dict[str, Any]]

Returns

A list of messages with their config sent via the Slack WebClient object