Skip to content

Incorrect logic when reading from local log files #30997

@zachliu

Description

@zachliu

Apache Airflow version

2.6.0

What happened

The logic of this line

if not (remote_logs and ti.state not in State.unfinished):

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 😂 It should be

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions