SDubrulle opened a new issue #17734:
URL: https://github.com/apache/airflow/issues/17734


   **Apache Airflow version**:
   
   2.1.0
   
   **OS**:
   
   Debian GNU/Linux 10
   
   **Apache Airflow Provider versions**:
   
   Irrelevant for this issue.
   
   **Deployment**:
   
   K8S using a custom helm chart
   
   **What happened**:
   
   When backfilling a DAG with a --mark-success flag, all tasks (within 
specified timerange) are set to success.
   
   **What you expected to happen**:
   
   I expected the task-level start_date and end_date to be taken into account. 
As such, a task-instance would only be created if the dag execution date is 
within the task date range.
   
   **How to reproduce it**:
   
   
   # BACKFILL COMMAND
   # airflow dags backfill -s 2020-08-01 -e 2021-8-18 --mark-success 
start_date_test_dag
   ##
   
   ## DAG
   from datetime import datetime
   from airflow.decorators import dag, task
   
   @dag(
       default_args={},
       description="Start date test DAG",
       schedule_interval="0 0 * * *",
       start_date=datetime(2021, 8, 1),
       catchup=True,
   )
   def start_date_test_dag():
   
       @task()
       def since_dag_start_date():
           print("Done")
   
       @task(start_date=datetime(2021, 8, 10))
       def task_defined_start_date():
           print("Done")
   
       [since_dag_start_date(), task_defined_start_date()]
   
   dag = start_date_test_dag()
   
   ## DAG END
   
   **Are you willing to submit a PR?**
   
   Sure, if this is unwanted behaviour and there is no workaround (other than 
backfilling each task individually).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to