You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by cr...@apache.org on 2016/06/21 15:23:54 UTC
[1/2] incubator-airflow git commit: [AIRFLOW-252] Raise Sqlite
exceptions when deleting tasks instance in WebUI
Repository: incubator-airflow
Updated Branches:
refs/heads/master 3ffa656d9 -> 072fa8ee5
[AIRFLOW-252] Raise Sqlite exceptions when deleting tasks instance in WebUI
If users who use SQLite as backend try to delete a task via browser, it fails with an exception.
Though this is a bug on Flask-Admin's side basically, this patch provides a workaround for it.
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/79d3be5b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/79d3be5b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/79d3be5b
Branch: refs/heads/master
Commit: 79d3be5b10d72538a605c7e24da31ccdd711013c
Parents: 45b735b
Author: Kengo Seki <se...@apache.org>
Authored: Mon Jun 20 23:03:22 2016 +0000
Committer: Kengo Seki <se...@apache.org>
Committed: Mon Jun 20 23:03:22 2016 +0000
----------------------------------------------------------------------
airflow/www/views.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/79d3be5b/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index f26ca7b..1fb3f91 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -38,6 +38,7 @@ from flask import (
from flask_admin import BaseView, expose, AdminIndexView
from flask_admin.contrib.sqla import ModelView
from flask_admin.actions import action
+from flask_admin.tools import iterdecode
from flask_login import flash
from flask._compat import PY2
@@ -2097,6 +2098,17 @@ class TaskInstanceModelView(ModelViewOnly):
raise Exception("Ooops")
flash('Failed to set state', 'error')
+ def get_one(self, id):
+ """
+ As a workaround for AIRFLOW-252, this method overrides Flask-Admin's ModelView.get_one().
+
+ TODO: this method should be removed once the below bug is fixed on Flask-Admin side.
+ https://github.com/flask-admin/flask-admin/issues/1226
+ """
+ task_id, dag_id, execution_date = iterdecode(id)
+ execution_date = dateutil.parser.parse(execution_date)
+ return self.session.query(self.model).get((task_id, dag_id, execution_date))
+
class ConnectionModelView(wwwutils.SuperUserMixin, AirflowModelView):
create_template = 'airflow/conn_create.html'
[2/2] incubator-airflow git commit: Merge pull request #1609 from
sekikn/AIRFLOW-252
Posted by cr...@apache.org.
Merge pull request #1609 from sekikn/AIRFLOW-252
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/072fa8ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/072fa8ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/072fa8ee
Branch: refs/heads/master
Commit: 072fa8ee53fd10e63dc82aec27cf137f0d5c30d9
Parents: 3ffa656 79d3be5
Author: Chris Riccomini <ch...@wepay.com>
Authored: Tue Jun 21 08:23:49 2016 -0700
Committer: Chris Riccomini <ch...@wepay.com>
Committed: Tue Jun 21 08:23:49 2016 -0700
----------------------------------------------------------------------
airflow/www/views.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------