[
https://issues.apache.org/jira/browse/AIRFLOW-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ash Berlin-Taylor closed AIRFLOW-4874.
--------------------------------------
Resolution: Information Provided
https://airflow.apache.org/concepts.html#airflowignore is the way to avoid this.
> 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)