[ https://issues.apache.org/jira/browse/AIRFLOW-619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15656108#comment-15656108
]
ASF subversion and git services commented on AIRFLOW-619:
---------------------------------------------------------
Commit 868bc83137adca0ebfd5780f0dff5a7bfdfaadf9 in incubator-airflow's branch refs/heads/master
from [~dgies]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=868bc83 ]
[AIRFLOW-619] Fix exception in Gannt chart
If a TaskInstance has no end_date, use
datetime.now()
Closes #1874 from dgies/master
> Gantt chart raises exception when there are running TaskInstances of the DagRun
> -------------------------------------------------------------------------------
>
> Key: AIRFLOW-619
> URL: https://issues.apache.org/jira/browse/AIRFLOW-619
> Project: Apache Airflow
> Issue Type: Bug
> Affects Versions: Airflow 2.0
> Reporter: Daniel Gies
> Labels: gantt
>
> If you view the Gantt chart for a DagRun while there are TaskInstances still running,
the Gantt chart throws an exception calling isoformat() on None because the task instance
has no end_date
> {code}
> Traceback (most recent call last):
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1817,
in wsgi_app
> response = self.full_dispatch_request()
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1477,
in full_dispatch_request
> rv = self.handle_user_exception(e)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1381,
in handle_user_exception
> reraise(exc_type, exc_value, tb)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1475,
in full_dispatch_request
> rv = self.dispatch_request()
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask/app.py", line 1461,
in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_admin/base.py", line
68, in inner
> return self._run_view(f, *args, **kwargs)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_admin/base.py", line
367, in _run_view
> return fn(self, *args, **kwargs)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/flask_login.py", line 755,
in decorated_view
> return func(*args, **kwargs)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/airflow/www/utils.py", line
125, in wrapper
> return f(*args, **kwargs)
> File "/home/dgies/airflow/venv/lib/python2.7/site-packages/airflow/www/views.py", line
1701, in gantt
> 'isoEnd': ti.end_date.isoformat()[:-4],
> AttributeError: 'NoneType' object has no attribute 'isoformat'
> {code}
> Proposed fix is to use `ti.end_date or datetime.now()` everywhere ti.end_date is used
in the view. This problem doesn't seem to affect any of the other views, only Gantt.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
|