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

DagBag stops reading DAGs and zipfiles if it does not encounter 'DAG' or 'airflow' in content

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0, 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Due to 

      https://github.com/apache/incubator-airflow/blob/0f4d681f6f6e15acd1399dede146e75cb688d536/airflow/models.py#L298 and 

      https://github.com/apache/incubator-airflow/blob/0f4d681f6f6e15acd1399dede146e75cb688d536/airflow/models.py#L332, Airflow will refuse to gather DAGs from a file which does not include the strings 'DAG' or 'airflow'. This can be problematic if you are using inheritance with your DAGs and thus don't import DAG in a file that generates a DAG.

      Worse, it stops scanning a zipfile altogether if any top-level files is missing the string.

       

      I'm not sure why these checks were included as it does not seem to provide any strong guarantee that the file is a DAG, so I suggest removing these odd checks.

        Attachments

          Activity

            People

            • Assignee:
              noremac201 Cameron Moberg
              Reporter:
              TrevorEdwards Trevor Edwards
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: