Skip to content

Commit

Permalink
organize dags folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel Gomez committed Oct 20, 2024
1 parent 1af236f commit 5804bab
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
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"]
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"]

0 comments on commit 5804bab

Please sign in to comment.