Created
November 30, 2021 13:23
-
-
Save cra/d21981fea11a2a8390a63d542da536a1 to your computer and use it in GitHub Desktop.
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 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