SnowflakeToSlackOperator

Use the snowflake_to_slack to post messages to predefined Slack channels.

Slack Webhook Airflow Connection Metadata

Parameter

Input

Host: string

Slack Webhook URL

Extra: dictionary

webhook_token (optional)

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:

tests/system/providers/snowflake/example_snowflake.py[source]


    slack_report = SnowflakeToSlackOperator(
        task_id="slack_report",
        sql=SNOWFLAKE_SLACK_SQL,
        slack_message=SNOWFLAKE_SLACK_MESSAGE,
        slack_conn_id=SLACK_CONN_ID,
    )

Was this entry helpful?