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:

airflow/providers/snowflake/example_dags/example_snowflake.pyView Source


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,
)

Was this entry helpful?