Skip to content

Instantly share code, notes, and snippets.

@iht
Created June 22, 2020 19:10
Show Gist options
  • Save iht/85c352f6451ff1c274b6b94a442dadb5 to your computer and use it in GitHub Desktop.
Save iht/85c352f6451ff1c274b6b94a442dadb5 to your computer and use it in GitHub Desktop.
"""Simple dag #2."""
from airflow import models
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators import python_operator
from airflow.utils.dates import days_ago
with models.DAG(
'dag_2',
schedule_interval='*/1 * * * *', # Every 1 minute
start_date=days_ago(0),
catchup=False) as dag:
def greeting():
"""Just check that the DAG is started in the log."""
import logging
logging.info('Hello World from DAG 2')
hello_python = python_operator.PythonOperator(
task_id='hello',
python_callable=greeting)
goodbye_dummy = DummyOperator(task_id='goodbye')
hello_python >> goodbye_dummy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment