Skip to content

Instantly share code, notes, and snippets.

@cra
Created November 30, 2021 13:23
Show Gist options
  • Select an option

  • Save cra/d21981fea11a2a8390a63d542da536a1 to your computer and use it in GitHub Desktop.

Select an option

Save cra/d21981fea11a2a8390a63d542da536a1 to your computer and use it in GitHub Desktop.
from airflow.models import DAG
from airflow.utils.dates import days_ago
from airflow.operators.dummy import DummyOperator
from airflow.operators.python_operator import PythonOperator
def foo(**context):
print(context['ds_nodash'])
with DAG(
dag_id="my_test",
schedule_interval=None,
start_date=days_ago(3),
catchup=False
) as dag:
op1 = DummyOperator(task_id="t1")
op2 = PythonOperator(task_id="t2", python_callable=foo)
op1 >> op2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment