kolfild26 opened a new issue, #33373: URL: https://github.com/apache/airflow/issues/33373
### Description Currently, in TimeDeltaSensor its `delta` interval starts from [its dagrun creation](https://github.com/apache/airflow/blob/main/airflow/sensors/time_delta.py#L44) but not from when the task's actually been running. ### Use case/motivation Imagine we've got some tasks before the TimeDeltaSensor task. In order to use TimeDeltaSensor we need to know their expected execution time and add this time to the sensor's delta parameter. Ok, it's not good for using but can be acceptable. But what if their expected execution time may vary for some reason from time to time? How to calculate the delta to be passed in sensor? So, is there any reason it's done this way? Wouldn't it be better if `delta` was attached to its task instance, which seems to be more intuitive. smth like this: ``` L44 target_dttm = context['task_instance'].start_date ``` ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- 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]
