airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Riccomini (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-97) "airflow" "DAG" strings in file necessary to import dag
Date Tue, 10 May 2016 18:05:12 GMT


Chris Riccomini commented on AIRFLOW-97:

We have the same use case and issue. We embed this in the .py files:

Note: it is important for this file to contain the strings 'airflow' and 'DAG'
in it. This is how Airflow detects if it should scan a file for module
attributes that are instance of DAG. See DagBag.process_file for details.

> "airflow" "DAG" strings in file necessary to import dag
> -------------------------------------------------------
>                 Key: AIRFLOW-97
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: scheduler
>    Affects Versions: Airflow 1.7.0
>            Reporter: Etiene Dalcol
>            Priority: Minor
> Hello airflow team! Thanks for the awesome tool!
> We made a small module to automate our DAG building process and we are using this module
on our DAG definition. Our airflow version is 1.7.0.
> However, airflow will not import this file because it doesn't have the words DAG and
airflow on it. (The imports etc are done inside our little module). Apparently there's a safe_mode
that skips files without these strings.
> (
> This safe_mode is default to True but is not passed to the process_file function, so
it is always True and there's no apparent way to disable it.
> (
> (
> Putting this comment on the top of the file makes it work for the moment and brought
me a good laugh today 👯 
> #DAG airflow —> DO NOT REMOVE. the world will explode

This message was sent by Atlassian JIRA

View raw message