Created
February 26, 2016 21:04
-
-
Save robinsonkwame/43acee57163dd5474a53 to your computer and use it in GitHub Desktop.
my basic dag
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
from airflow import DAG | |
from airflow.operators import BashOperator, DummyOperator | |
from datetime import datetime, timedelta | |
default_args = { | |
'owner':'kwame', | |
'depends_on_past':True, | |
'start_date': datetime.today()-timedelta(days=7) | |
} | |
sch_int = '@once' | |
dag = DAG('my_dag', | |
schedule_interval=sch_int, | |
default_args=default_args) | |
g1 = DummyOperator( | |
task_id='staging', | |
dag=dag) | |
cmd = 'sleep 120' | |
t1 = BashOperator( | |
task_id='datahubio', | |
bash_command=cmd, | |
dag=dag) | |
final = DummyOperator( | |
task_id='done', | |
dag=dag) | |
g1.set_downstream(t1) | |
final.set_upstream(t1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment