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

Ash Berlin-Taylor commented on AIRFLOW-2613:
--------------------------------------------

Stopping walking the Zipfile sounds like a bug and should be fixed.

My fix for this was to put {{# airflow.DAG - do not remove}} in a comment.

I would like to see this safety check toggleable behind a config flag so that 
for now the default is with it still enabled.

> DagBag stops reading DAGs and zipfiles if it does not encounter 'DAG' or 
> 'airflow' in content
> ---------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-2613
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2613
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Trevor Edwards
>            Assignee: Cameron Moberg
>            Priority: Major
>
> 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.



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

Reply via email to