You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jeremiah Lowin (JIRA)" <ji...@apache.org> on 2017/03/16 03:12:41 UTC

[jira] [Created] (AIRFLOW-993) Dags should modify the start date and end date of tasks when they are added

Jeremiah Lowin created AIRFLOW-993:
--------------------------------------

             Summary: 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.1


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 would make sense for the DAG to set the task start_date as the later of the task's start date and its own start date; or the earlier for end_date.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)