-
Notifications
You must be signed in to change notification settings - Fork 0
/
twitter_dag.py
32 lines (28 loc) · 1.05 KB
/
twitter_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
from datetime import timedelta
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago
from datetime import datetime
from twitter_etl import run_twitter_etl
default_args = {
'owner': 'airflow', # Setting Owner of the Dag.
'depends_on_past': False, # Only one Dag, So set False.
'start_date': datetime(2020, 11, 8), # When to start the dag.
'email': ['[email protected]'], # To get email notification.
'email_on_failure': False, # To get email on failure.
'email_on_retry': False, # To get email on retry.
'retries': 1, # Number of retry.
'retry_delay': timedelta(minutes=1) # delay between each retry.
}
dag = DAG(
'twitter_dag',
default_args=default_args,
description='My first etl code',
schedule_interval=timedelta(days=1)
)
run_etl = PythonOperator(
task_id='complete_twitter_etl',
python_callable=run_twitter_etl,
dag=dag,
)
run_etl