Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-5485

scheduler_job: replace == None with is_() comparison

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.6
    • Fix Version/s: None
    • Component/s: hooks
    • Labels:

      Description

      Note: This ticket's being created to facilitate a new contributor's workshop for Airflow. After the workshop has completed, I'll mark these all available for anyone that might like to take them on.

      airflow/jobs/scheduler_job.py:855

      .filter(or_(DR.run_id == None,  # noqa: E711 pylint: disable=singleton-comparison
                  not_(DR.run_id.like(BackfillJob.ID_PREFIX + '%'))))
      .outerjoin(DM, DM.dag_id == TI.dag_id)
      .filter(or_(DM.dag_id == None,  # noqa: E711 pylint: disable=singleton-comparison
              not_(DM.is_paused))) 

      We're using col == None here where we should use col.is_(None) to avoid confusion as and lint warnings. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sdhupar Saurabh Dhupar
                Reporter:
                jghoman Jakob Homan
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: