-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment.py
More file actions
66 lines (51 loc) · 2.12 KB
/
Copy pathassignment.py
File metadata and controls
66 lines (51 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 9, 10),
# 'schedule_interval': '@daily',
'email': ['ahmedrad@gmail.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5)
}
dag = DAG('assignment', default_args=default_args, schedule_interval=timedelta(1))
dag.catchup = False
# t1, t2 and t3 are examples of tasks created by instantiating operators
t1 = BashOperator(
task_id='extract__crawler_report_csv',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/extract__crawler_report_csv.py',
dag=dag)
t2 = BashOperator(
task_id='compute__under10RankingCount_perUrl_forAllTimePeriod',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/compute__under10RankingCount_perUrl_forAllTimePeriod.py',
dag=dag)
t2.set_upstream(t1)
t3 = BashOperator(
task_id='load__under10RankingCount_perUrl_forAllTimePeriod',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/load__under10RankingCount_perUrl_forAllTimePeriod.py',
dag=dag)
t3.set_upstream(t2)
t4 = BashOperator(
task_id='compute__topUrlChangesCount_perKeywordInfo_forAllTimePeriod',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/compute__topUrlChangesCount_perKeywordInfo_forAllTimePeriod.py',
dag=dag)
t4.set_upstream(t1)
t5 = BashOperator(
task_id='load__topUrlChangesCount_perKeywordInfo_forAllTimePeriod',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/load__topUrlChangesCount_perKeywordInfo_forAllTimePeriod.py',
dag=dag)
t5.set_upstream(t4)
t6 = BashOperator(
task_id='compute__deviceRankingDifference_perDay',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/compute__deviceRankingDifference_perDay.py',
dag=dag)
t6.set_upstream(t1)
t7 = BashOperator(
task_id='load__deviceRankingDifference_perDay',
bash_command='ipython ~/airflow/StatSearchAnalysis/ETL/load__deviceRankingDifference_perDay.py',
dag=dag)
t7.set_upstream(t6)