Hello World 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 datetime import datetime | |
from airflow import DAG | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.operators import MultiplyBy5Operator | |
def print_hello(): | |
return 'Hello Wolrd' | |
dag = DAG('hello_world', description='Hello world example', schedule_interval='0 12 * * *', 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) | |
multiplyby5_operator = MultiplyBy5Operator(my_operator_param='my_operator_param', | |
task_id='multiplyby5_task', dag=dag) | |
dummy_operator >> hello_operator | |
dummy_operator >> multiplyby5_operator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ImportError: cannot import name 'MultiplyBy5Operator' from 'airflow.operators'