zachliu opened a new issue, #30997:
URL: https://github.com/apache/airflow/issues/30997

   ### Apache Airflow version
   
   2.6.0
   
   ### What happened
   
   The logic of this line 
https://github.com/apache/airflow/blob/ab54c63940a99646df974d4bcf2e37415e277e69/airflow/utils/log/file_task_handler.py#L323
   is incorrect.
   
   We are trying to achieve:
   * `when finished, if we don't have remote logs, then read from local`
   
   But the this line does the opposite:
   * `when not not unfinished (not finished), if we don't have remote logs, 
then read from local`
   
   Also, the "triple negation logic" is really hard to read :joy: It should be
   
   ```python
   if ti.state in State.finished and not remote_logs:
   ```
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   Run 2.6.0 with local logs
   
   ### Operating System
   
   Irrelevant 
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit 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]

Reply via email to