jan920 opened a new issue #21095:
URL: https://github.com/apache/airflow/issues/21095


   ### Apache Airflow version
   
   2.2.3 (latest released)
   
   ### What happened
   
   When using deferrable operators `task_instance` doesn't have correct 
`start_date` and it is qual or close to `end_date` even when the task takes 
significant amount of time.
   
   For example I used operator:
   
   ```
   from airflow.sensors.time_delta import TimeDeltaSensorAsync
   import datetime
   
   job1 = TimeDeltaSensorAsync(delta=datetime.timedelta(seconds=120), 
task_id='job1')
   ```
   
   During the run the `Gantt` was showing correct values on frontend: 
   ![Screenshot 2022-01-25 at 14 19 
22](https://user-images.githubusercontent.com/38770318/150984950-406e1d2b-3a14-4b2c-b255-773cb2b7f882.png)
   
   
   But after the run I can see that the `start_date` and `end_date` are the 
same.
   
   ![Screenshot 2022-01-25 at 14 20 
23](https://user-images.githubusercontent.com/38770318/150985024-da5f894b-bc46-40b1-9af7-15d68a99a4a1.png)
   
   ![Screenshot 2022-01-25 at 14 20 
05](https://user-images.githubusercontent.com/38770318/150985033-c4e93a53-d165-46c7-853c-164547d0516d.png)
   
   
   
   ### What you expected to happen
   
   I think `start_date` should be equal to the actual datetime when the task 
started.
   
   ### How to reproduce
   
   I was able to reproduce this by using following operator: 
   
   ```
   from airflow.sensors.time_delta import TimeDeltaSensorAsync
   import datetime
   
   job1 = TimeDeltaSensorAsync(delta=datetime.timedelta(seconds=120), 
task_id='job1')
   ```
   
   ### Operating System
   
   Darwin 21.1.0 x86_64
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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]


Reply via email to