-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from georgetown-cset/trigger-updates
Separate pre-linkage and post-linkage triggers
- Loading branch information
Showing
4 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
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
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,51 @@ | ||
from airflow import DAG | ||
from airflow.operators.trigger_dagrun import TriggerDagRunOperator | ||
from airflow.operators.dummy import DummyOperator | ||
from datetime import timedelta, datetime | ||
|
||
from dataloader.airflow_utils.slack import task_fail_slack_alert | ||
|
||
|
||
default_args = { | ||
"owner": "airflow", | ||
"depends_on_past": False, | ||
"start_date": datetime(2022, 3, 5), | ||
"email": ["jennifer.melot@georgetown.edu"], | ||
"email_on_failure": True, | ||
"email_on_retry": True, | ||
"retries": 0, | ||
"retry_delay": timedelta(minutes=5), | ||
"on_failure_callback": task_fail_slack_alert | ||
} | ||
|
||
with DAG("org_er_and_metadata_merge", | ||
default_args=default_args, | ||
description="Triggers Org ER and metadata merge dags", | ||
schedule_interval=None, | ||
catchup=False | ||
) as dag: | ||
|
||
trigger_orgfixes1 = TriggerDagRunOperator( | ||
task_id="trigger_orgfixes1", | ||
trigger_dag_id="org_fixes", | ||
wait_for_completion=True | ||
) | ||
trigger_bulk_org_er_updater = TriggerDagRunOperator( | ||
task_id="trigger_bulk_org_er_updater", | ||
trigger_dag_id="bulk_org_er_updater", | ||
wait_for_completion=True | ||
) | ||
trigger_orgfixes2 = TriggerDagRunOperator( | ||
task_id="trigger_orgfixes2", | ||
trigger_dag_id="org_fixes", | ||
wait_for_completion=True | ||
) | ||
trigger_merge = TriggerDagRunOperator( | ||
task_id="trigger_merged_article_metadata_updater", | ||
trigger_dag_id="merged_article_metadata_updater", | ||
wait_for_completion=True | ||
) | ||
|
||
trigger_orgfixes1 >> trigger_bulk_org_er_updater >> trigger_orgfixes2 >> trigger_merge | ||
|
||
|
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
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