tirkarthi opened a new pull request, #35984: URL: https://github.com/apache/airflow/pull/35984
closes: #35288 related: #35288 When a task is deferred then the same attempt is used to queue and resume causing the queued_dttm to be greater than start_date for an execution. This causes queued duration to be displayed with incorrect value taking queued_dttm - start_date which is not correct since start_date should always be greater than queued time. Also this causes start offset and to have a fixed queued duration bar width of 5. start offset and queued duration min width are shown only when queued_dttm is valid by being greater than start_date. Before patch : (Incorrect queued duration of 23 hours and start of the bar is incorrect)  After patch : (queued duration is 0 since queued_dttm is greater than start_date. start_date position is also correct in gantt as per start_date)  Sample dag : ```python from __future__ import annotations from datetime import datetime from airflow import DAG from airflow.models.baseoperator import BaseOperator from airflow.triggers.file import FileTrigger class FileCheckOperator(BaseOperator): def __init__(self, filepath, **kwargs): self.filepath = filepath super().__init__(**kwargs) def execute(self, context): self.log.info("https://example.com") self.defer( trigger=FileTrigger(filepath=self.filepath), method_name="execute_complete", ) def execute_complete(self, context, event=None): pass with DAG( dag_id="file_trigger", start_date=datetime(2021, 1, 1), catchup=False, schedule_interval=None, ) as dag: t1 = FileCheckOperator(task_id="t1", filepath="/tmp/a") t2 = FileCheckOperator(task_id="t2", filepath="/tmp/b") t1 t2 ``` -- 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]
