Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import datetime
import logging
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
def my_function():
logging.info("Hello World")
dag = DAG(
'sample_dag',
start_date=datetime.datetime.now())
my_task = PythonOperator(
task_id="first_task_say_hello",
python_callable=my_function,
dag=dag
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment