You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Joy Gao (JIRA)" <ji...@apache.org> on 2017/12/08 23:44:01 UTC

[jira] [Created] (AIRFLOW-1904) Correct DAG fileloc

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)