airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-365) Code view in subdag trigger exception
Date Thu, 02 Feb 2017 12:57:51 GMT


ASF subversion and git services commented on AIRFLOW-365:

Commit cf102c372d06a73b4772e6453f2273e27a551900 in incubator-airflow's branch refs/heads/master
from [~dxhuang]
[;h=cf102c3 ]

[AIRFLOW-365] Set dag.fileloc explicitly and use for Code view

Code view for subdag has not been working. I do
not think we are able
cleanly figure out where the code for the factory
method lives when we
process the dags, so we need to save the location
when the subdag is

Previously for a subdag, its `fileloc` attribute
would be set to the
location of the parent dag. I think it is
appropriate to instead set
it to the actual child dag location instead. We do
not lose any
information this way (we still have the link to
the parent dag that
has its location) and now we can always read this
attribute for the
code view. This should not affect the use of this
field for refreshing
dags, because we always refresh the parent for a

Closes #2043 from dhuang/AIRFLOW-365

> Code view in subdag trigger exception
> -------------------------------------
>                 Key: AIRFLOW-365
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: ui
>    Affects Versions: Airflow
>         Environment: Centos 7
>            Reporter: marco pioltelli
>            Assignee: Daniel Huang
>            Priority: Minor
> Hi,
> first of all this product is wonderful.
> I have created my DAG with subdag.
> It works very well, the following issue happen on the UI:
> - going into the dag, selecting (zoom into) a subdag
> - clicking into the Code section to view the code, the following exception is triggered
> -------------------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/flask/", line 1817, in wsgi_app
>     response = self.full_dispatch_request()
>   File "/usr/lib/python2.7/site-packages/flask/", line 1477, in full_dispatch_request
>     rv = self.handle_user_exception(e)
>   File "/usr/lib/python2.7/site-packages/flask/", line 1381, in handle_user_exception
>     reraise(exc_type, exc_value, tb)
>   File "/usr/lib/python2.7/site-packages/flask/", line 1475, in full_dispatch_request
>     rv = self.dispatch_request()
>   File "/usr/lib/python2.7/site-packages/flask/", line 1461, in dispatch_request
>     return self.view_functions[rule.endpoint](**req.view_args)
>   File "/usr/lib/python2.7/site-packages/flask_admin/", line 68, in inner
>     return self._run_view(f, *args, **kwargs)
>   File "/usr/lib/python2.7/site-packages/flask_admin/", line 367, in _run_view
>     return fn(self, *args, **kwargs)
>   File "/usr/lib/python2.7/site-packages/", line 755, in decorated_view
>     return func(*args, **kwargs)
>   File "/usr/lib/python2.7/site-packages/airflow/www/", line 655, in code
>     m = importlib.import_module(dag.module_name)
> AttributeError: 'DAG' object has no attribute 'module_name'
> It seems it is searching for a DAG instead for a subdag
> This also happens  with the example sub dag operator.
> Thanks
> Marco

This message was sent by Atlassian JIRA

View raw message