-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeals_dag.py
40 lines (34 loc) · 944 Bytes
/
deals_dag.py
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
from datetime import timedelta
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago
from fetch_images import getImages
from extract_deals import getDeals
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': days_ago(1),
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 0,
'retry_delay': timedelta(minutes=5)
}
dag = DAG(
'bb_deals_dag',
default_args=default_args,
description='DAG for fetching deals and images for BudgetBoss',
schedule_interval='*/15 * * * *',
catchup=False
)
fetch_deals_task = PythonOperator(
task_id='fetch_new_deals',
python_callable=getDeals,
dag=dag,
)
fetch_images_task = PythonOperator(
task_id='fetch_new_images',
python_callable=getImages,
dag=dag,
)
fetch_deals_task >> fetch_images_task