airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joy Gao (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-1904) Correct DAG fileloc
Date Fri, 08 Dec 2017 23:44:01 GMT
Joy Gao created AIRFLOW-1904:
--------------------------------

             Summary: Correct DAG fileloc
                 Key: AIRFLOW-1904
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1904
             Project: Apache Airflow
          Issue Type: Bug
            Reporter: Joy Gao
            Assignee: Joy Gao


Currently dag file location `dag.fileloc` is determined by getting the second stack frame
from the top, i.e.:

self.fileloc = sys._getframe().f_back.f_code.co_filename

However this fails if the DAG is constructed in an imported module. For example, if I import
a DagBuilder in my dagfile, the dagbuilder's filepath would ended up becoming the fileloc,
rather than the dag itself. 

This causes a bug whenever the DAG is attempted to be refreshed, with the message:
```This DAG isn't available in the web server's DagBag object. It shows up in this list because
the scheduler marked it as active in the metadata database.```



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message