I found out two example dag with .now in our code base https://github.com/apache/airflow/blob/1f192121b0c769cf07af052327f503b3a47c77a0/airflow/example_dags/example_trigger_target_dag.py#L47
https://github.com/apache/airflow/blob/1f192121b0c769cf07af052327f503b3a47c77a0/airflow/example_dags/example_trigger_controller_dag.py#L60 and two in annotation example dag https://github.com/apache/airflow/blob/1f192121b0c769cf07af052327f503b3a47c77a0/airflow/example_dags/example_docker_operator.py#L28 https://github.com/apache/airflow/blob/1f192121b0c769cf07af052327f503b3a47c77a0/airflow/example_dags/docker_copy_data.py#L40 Best wish. -- Jiajie ________________________________ From: Kaxil Naik <[email protected]> Sent: Saturday, May 11, 2019 17:27 To: [email protected] Subject: Re: [DISCUSS] Change all example_dags's start_date to specific datetime I don't think any example dag contains ".now()" date. If it foes we need to change. But the others contains dynamic dates before 2 days which are sensible as catchup=True be default On Fri, May 10, 2019, 15:07 [email protected] < [email protected]> wrote: > Hi Airflower: > I start this thread proposal to change all example_dags's start_date > to specific datetime, including airflow/example_dag and > airflow/contrib/example_dags. > I proposal that because in > https://airflow.apache.org/faq.html#what-s-the-deal-with-start-date > > > We recommend against using dynamic values as start_date, especially > datetime.now() as it can be quite confusing. The task is triggered once the > period closes, and in theory an @hourly DAG would never get to an hour > after now as now() moves along. > > we suggest to set start_date to specific datetime, but all example_dags in > code base are use dynamic values like `airflow.utils.dates.days_ago(2)` or > `datetime.utcnow()`. Most of Airflow starter will use example dag as they > template to create their own dag, so I think should change them in correct > values. > > But if we use a specific datetime in example dag, for example 2019-01-01, > starter will use them as template and confuse "Why my dag start run in > 2019-01-01?". > > So, should we change start_date? > > This proposal start in slack #users-china channel > https://apache-airflow.slack.com/archives/CGQ4A9DCZ/p1557467228006100 . >
