Created
August 18, 2020 20:54
-
-
Save kinow/5d1cdb7965d912d8540e3ed6830b8ef0 to your computer and use it in GitHub Desktop.
DAG example workflows
This file contains hidden or 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 datetime import datetime | |
from airflow import DAG | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.operators.python_operator import PythonOperator | |
def print_hello(): | |
return 'Hello world!' | |
# schedule_interval supports CRON syntax | |
dag = DAG('hello_world', description='Simple tutorial DAG', | |
schedule_interval='* * * * *', | |
start_date=datetime(2017, 3, 20), catchup=False) | |
dummy_operator = DummyOperator(task_id='dummy_task', retries=3, dag=dag) | |
hello_operator = PythonOperator(task_id='hello_task', python_callable=print_hello, dag=dag) | |
dummy_operator >> hello_operator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment