You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/12/22 13:03:00 UTC

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

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

ASF subversion and git services commented on AIRFLOW-1904:
----------------------------------------------------------

Commit 1c8972df42d824e5a740c56b302f71158e7224d8 in incubator-airflow's branch refs/heads/master from [~joy.gao54]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=1c8972d ]

[AIRFLOW-1904] Correct DAG fileloc to the right filepath

Closes #2863 from jgao54/fix-fileloc


> 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
>             Fix For: 1.10.0, 1.9.1, 2.0.0
>
>
> 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 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)