SnowflakeToSlackOperator¶
Use the snowflake_to_slack
to post messages to predefined Slack
channels.
Parameter |
Input |
---|---|
Host: string |
Slack Webhook URL |
Extra: dictionary |
|
Using the Operator¶
Similarly to the SnowflakeOperator
, use the snowflake_conn_id
and
the additional relevant parameters to establish connection with your Snowflake instance.
This operator will execute a custom query on a selected Snowflake table and publish a Slack message that can be formatted
and contain the resulting dataset (e.g. ASCII formatted dataframe).
An example usage of the SnowflakeToSlackOperator is as follows:
slack_report = SnowflakeToSlackOperator(
task_id="slack_report",
sql=SNOWFLAKE_SLACK_SQL,
slack_message=SNOWFLAKE_SLACK_MESSAGE,
snowflake_conn_id=SNOWFLAKE_CONN_ID,
slack_conn_id=SLACK_CONN_ID,
dag=dag,
)