You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Michael Graessle (JIRA)" <ji...@apache.org> on 2019/07/01 15:19:00 UTC

[jira] [Created] (AIRFLOW-4874) Any py file containing the text DAG will be loaded as a DAG, even if DAG is in comments

Michael Graessle created AIRFLOW-4874:
-----------------------------------------

             Summary: Any py file containing the text DAG will be loaded as a DAG, even if DAG is in comments
                 Key: AIRFLOW-4874
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4874
             Project: Apache Airflow
          Issue Type: Bug
          Components: DAG
    Affects Versions: 1.9.0
            Reporter: Michael Graessle


Any py file that contains the text DAG in text will be loaded as a DAG, even if the text is only  in a comment.  This leads to "broken dag" text in UI and error messages in the task logs. 

This is easy to work around just by changing the text DAG => dag but is fairly large gotcha as developers don't expect commented out lines to affect the runtime.  

This is also hard to resolve as the error is often unrelated to the real issue.  In our case the comment in a main block (if __name__ == "__main__" ) and shouldn't have been running at all but was failing on the file's imports.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)