Skip to content

Instantly share code, notes, and snippets.

@fbdiehlad
Last active June 24, 2016 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbdiehlad/9e356d9a303339eb3c3f1be3475efce2 to your computer and use it in GitHub Desktop.
Save fbdiehlad/9e356d9a303339eb3c3f1be3475efce2 to your computer and use it in GitHub Desktop.
from airflow import DAG
from airflow.operators import PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2016, 5, 1),
'email': ['alex'],
'email_on_failure': True,
'email_on_retry': False,
'retries': 3,
'retry_delay': timedelta(minutes=5),
# 'queue': 'bash_queue',
# 'pool': 'backfill',
# 'priority_weight': 10,
# 'end_date': datetime(2016, 1, 1),
}
dag = DAG(
dag_id='python_testing_dag',
default_args=default_args,
schedule_interval='@daily'
)
def super_simple_python(**kwargs):
return 'Please no failures.'
test = PythonOperator(
task_id='testing',
python_callable=super_simple_python,
dag=dag
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment