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

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

    [ https://issues.apache.org/jira/browse/AIRFLOW-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16892258#comment-16892258 ] 

Sergio Kef commented on AIRFLOW-4874:
-------------------------------------

Hmm, I think this is a main point of discussions and debates.

How would you differentiate between dags and non-dags?

> 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
>            Priority: Major
>
> 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.14#76016)