Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
For the article Understanding airflow start_date and execution_date
dag = DAG(
dag_id="sample_dag",
schedule_interval="@daily",
start_date=dt.datetime(2022, 01, 01),
)
def _print_execution_date(ds):
print(f"The execution date of this flow is {ds}")
print_dag = PythonOperator(
task_id='print_task',
python_callable=_print_execution_date,
dag=dag,
)
import datetime as dt
from airflow import DAG
dag = DAG(
dag_id="sample_dag",
schedule_interval="@daily",
start_date=dt.datetime(2022, 01, 01),
)
dag = DAG(
dag_id="sample_dag",
schedule_interval="@daily",
start_date=dt.datetime(2021, 12, 01),
catchup=False,
)
start_date=dt.datetime(2021, 12, 1)
start_date=dt.datetime(2021, 12, 31)
start_date=dt.datetime.today()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment