Skip to content

Instantly share code, notes, and snippets.

@robinsonkwame
Created February 26, 2016 21:04
Show Gist options
  • Save robinsonkwame/43acee57163dd5474a53 to your computer and use it in GitHub Desktop.
Save robinsonkwame/43acee57163dd5474a53 to your computer and use it in GitHub Desktop.
my basic dag
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