-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noel Gomez
committed
Oct 20, 2024
1 parent
1af236f
commit 5804bab
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions
47
orchestrate/dags_yml_definitions/notifications_examples/yaml_slack_dag.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
description: "Sample DAG with Slack notification, custom image, and resource requests" | ||
schedule_interval: "0 0 1 */12 *" | ||
tags: | ||
- version_2 | ||
- slack_notification | ||
- blue_green | ||
default_args: | ||
start_date: 2023-01-01 | ||
owner: Noel Gomez | ||
# Replace with the email of the recipient for failures | ||
email: gomezn@example.com | ||
email_on_failure: true | ||
catchup: false | ||
|
||
# Optional callbacks used to send Slack notifications | ||
notifications: | ||
on_success_callback: | ||
notifier: airflow.providers.slack.notifications.slack.send_slack_notification | ||
args: | ||
text: "The DAG {{ dag.dag_id }} succeeded" | ||
channel: "#general" | ||
on_failure_callback: | ||
notifier: airflow.providers.slack.notifications.slack.send_slack_notification | ||
args: | ||
text: "The DAG {{ dag.dag_id }} failed" | ||
channel: "#general" | ||
|
||
# DAG Tasks | ||
nodes: | ||
transform: | ||
operator: operators.datacoves.dbt.DatacovesDbtOperator | ||
type: task | ||
config: | ||
image: datacoves/airflow-pandas:latest | ||
resources: | ||
memory: 8Gi | ||
cpu: 1000m | ||
|
||
bash_command: "dbt run -s personal_loans" | ||
|
||
# Sample failing task to test that notification is sent | ||
# failing_task: | ||
# operator: operators.datacoves.bash.DatacovesBashOperator | ||
# type: task | ||
|
||
# bash_command: "some_non_existant_command" | ||
# dependencies: ["transform"] |
44 changes: 44 additions & 0 deletions
44
orchestrate/dags_yml_definitions/notifications_examples/yaml_teams_dag.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
description: "Sample DAG with MS Teams notification" | ||
schedule_interval: "0 0 1 */12 *" | ||
tags: | ||
- version_2 | ||
- ms_teams_notification | ||
- blue_green | ||
default_args: | ||
start_date: 2023-01-01 | ||
owner: Noel Gomez | ||
# Replace with the email of the recipient for failures | ||
email: gomezn@example.com | ||
email_on_failure: true | ||
catchup: false | ||
|
||
# Optional callbacks used to send MS Teams notifications | ||
notifications: | ||
on_success_callback: | ||
notifier: notifiers.datacoves.ms_teams.MSTeamsNotifier | ||
args: | ||
connection_id: DATACOVES_MS_TEAMS | ||
# message: Custom success message | ||
theme_color: 0000FF | ||
on_failure_callback: | ||
notifier: notifiers.datacoves.ms_teams.MSTeamsNotifier | ||
args: | ||
connection_id: DATACOVES_MS_TEAMS | ||
# message: Custom error message | ||
theme_color: 9900FF | ||
|
||
# DAG Tasks | ||
nodes: | ||
transform: | ||
operator: operators.datacoves.dbt.DatacovesDbtOperator | ||
type: task | ||
|
||
bash_command: "dbt run -s personal_loans" | ||
|
||
# Sample failing task to test that notification is sent | ||
# failing_task: | ||
# operator: operators.datacoves.bash.DatacovesBashOperator | ||
# type: task | ||
|
||
# bash_command: "some_non_existant_command" | ||
# dependencies: ["transform"] |