You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by sa...@apache.org on 2016/10/26 21:42:34 UTC
incubator-airflow git commit: [AIRFLOW-453] Add XCom Admin Page
Repository: incubator-airflow
Updated Branches:
refs/heads/master 84cb7e809 -> 2bbcdc3a9
[AIRFLOW-453] Add XCom Admin Page
Closes #1756 from msumit/AIRFLOW-453
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/2bbcdc3a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/2bbcdc3a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/2bbcdc3a
Branch: refs/heads/master
Commit: 2bbcdc3a9958103db49fb98727831d1aee4e12ed
Parents: 84cb7e8
Author: Sumit Maheshwari <su...@qubole.com>
Authored: Wed Oct 26 14:42:18 2016 -0700
Committer: Siddharth Anand <si...@yahoo.com>
Committed: Wed Oct 26 14:42:18 2016 -0700
----------------------------------------------------------------------
airflow/www/app.py | 2 ++
airflow/www/views.py | 21 +++++++++++++++++++++
tests/core.py | 2 ++
3 files changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/2bbcdc3a/airflow/www/app.py
----------------------------------------------------------------------
diff --git a/airflow/www/app.py b/airflow/www/app.py
index c4dff6f..6ab4ffd 100644
--- a/airflow/www/app.py
+++ b/airflow/www/app.py
@@ -89,6 +89,8 @@ def create_app(config=None):
models.Connection, Session, name="Connections", category="Admin"))
av(vs.VariableView(
models.Variable, Session, name="Variables", category="Admin"))
+ av(vs.XComView(
+ models.XCom, Session, name="XComs", category="Admin"))
admin.add_link(base.MenuLink(
category='Docs', name='Documentation',
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/2bbcdc3a/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index b0ccfaa..36384d8 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2161,6 +2161,27 @@ class VariableView(wwwutils.DataProfilingMixin, AirflowModelView):
form.val.data = '*' * 8
+class XComView(wwwutils.LoginMixin, AirflowModelView):
+ verbose_name = "XCom"
+ verbose_name_plural = "XComs"
+ page_size = 20
+
+ form_columns = (
+ 'key',
+ 'value',
+ 'execution_date',
+ 'task_id',
+ 'dag_id',
+ )
+
+ form_extra_fields = {
+ 'value': StringField('Value'),
+ }
+
+ column_filters = ('key', 'timestamp', 'execution_date', 'task_id', 'dag_id')
+ column_searchable_list = ('key', 'timestamp', 'execution_date', 'task_id', 'dag_id')
+
+
class JobModelView(ModelViewOnly):
verbose_name_plural = "jobs"
verbose_name = "job"
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/2bbcdc3a/tests/core.py
----------------------------------------------------------------------
diff --git a/tests/core.py b/tests/core.py
index 9ce71d4..e2612f4 100644
--- a/tests/core.py
+++ b/tests/core.py
@@ -1399,6 +1399,8 @@ class WebUiTests(unittest.TestCase):
response = self.app.get(
"/admin/airflow/paused?"
"dag_id=example_python_operator&is_paused=false")
+ response = self.app.get("/admin/xcom", follow_redirects=True)
+ assert "Xcoms" in response.data.decode('utf-8')
def test_charts(self):
session = Session()