[
https://issues.apache.org/jira/browse/AIRFLOW-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16009331#comment-16009331
]
ASF subversion and git services commented on AIRFLOW-993:
---------------------------------------------------------
Commit 624c133925c268d2c640356be29388651d25a325 in incubator-airflow's branch
refs/heads/master from [~jlowin]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=624c133 ]
[AIRFLOW-993] Update date inference logic
DAGs should set task start_date and end_date when
possible, making sure
they agree with the DAG’s own dates.
Closes #2157 from jlowin/run-bug
> Dags should modify the start date and end date of tasks when they are added
> ---------------------------------------------------------------------------
>
> Key: AIRFLOW-993
> URL: https://issues.apache.org/jira/browse/AIRFLOW-993
> Project: Apache Airflow
> Issue Type: Bug
> Components: DAG
> Affects Versions: 1.8.0
> Reporter: Jeremiah Lowin
> Assignee: Jeremiah Lowin
> Priority: Minor
> Fix For: 1.8.2
>
>
> When tasks are added to DAGs, the DAG checks if the task has a start_date. If
> it doesn't, the DAG sets it to its own start date. This isn't done for
> end_date, but it should be.
> Otherwise, this simple code leads to a surprising failure as the backfill
> tries to run the task every day, even though the DAG clearly has an end date
> set.
> {code}
> from airflow.models import DAG
> from airflow.operators.dummy_operator import DummyOperator
> import datetime
> dt = datetime.datetime(2017, 1, 1)
> with DAG('test', start_date=dt, end_date=dt) as dag:
> op = DummyOperator(task_id='dummy')
> op.run()
> {code}
> Furthermore, it may make sense for the task start date to always be the later
> of the task start date and the dag start date; similarly for the end date
> (but using the earlier date)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)