[AIRFLOW-238] Make compatible with flask-admin 1.4.1 The new flask-admin==1.4.1 release on 2016-06-13 breaks the Airflow release currently in Pypi (1.7.1.2). This fixes the edge case triggered by this new release.
* Closes #1588 on github Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/bae76e81 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/bae76e81 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/bae76e81 Branch: refs/heads/branch-1.7.2-apache Commit: bae76e81b846da2d54cf1d895c57fa3913ca3463 Parents: 55ac7b5 Author: Maxime Beauchemin <[email protected]> Authored: Tue Jun 14 12:22:05 2016 +0200 Committer: Bolke de Bruin <[email protected]> Committed: Mon Jul 11 15:29:16 2016 +0200 ---------------------------------------------------------------------- airflow/__init__.py | 2 +- airflow/www/views.py | 16 ++++++---------- setup.py | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/bae76e81/airflow/__init__.py ---------------------------------------------------------------------- diff --git a/airflow/__init__.py b/airflow/__init__.py index 900c744..9185c9e 100644 --- a/airflow/__init__.py +++ b/airflow/__init__.py @@ -20,7 +20,7 @@ in their PYTHONPATH. airflow_login should be based off the `airflow.www.login` """ from builtins import object -__version__ = "1.7.1" +__version__ = "1.7.1.3" import logging import os http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/bae76e81/airflow/www/views.py ---------------------------------------------------------------------- diff --git a/airflow/www/views.py b/airflow/www/views.py index 6e3ff42..c55800a 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -90,14 +90,9 @@ def dag_link(v, c, m, p): '<a href="{url}">{m.dag_id}</a>'.format(**locals())) -def log_link(v, c, m, p): - url = url_for( - 'airflow.log', - dag_id=m.dag_id, - task_id=m.task_id, - execution_date=m.execution_date.isoformat()) +def log_url_formatter(v, c, m, p): return Markup( - '<a href="{url}">' + '<a href="{m.log_url}">' ' <span class="glyphicon glyphicon-book" aria-hidden="true">' '</span></a>').format(**locals()) @@ -815,7 +810,7 @@ class Airflow(BaseView): host = ti.hostname log_loaded = False - if socket.gethostname() == host: + if os.path.exists(loc): try: f = open(loc) log += "".join(f.readlines()) @@ -2100,7 +2095,8 @@ class TaskInstanceModelView(ModelViewOnly): 'queue', 'pool', 'operator', 'start_date', 'end_date') named_filter_urls = True column_formatters = dict( - log=log_link, task_id=task_instance_link, + log_url=log_url_formatter, + task_id=task_instance_link, hostname=nobr_f, state=state_f, execution_date=datetime_f, @@ -2121,7 +2117,7 @@ class TaskInstanceModelView(ModelViewOnly): 'state', 'dag_id', 'task_id', 'execution_date', 'operator', 'start_date', 'end_date', 'duration', 'job_id', 'hostname', 'unixname', 'priority_weight', 'queue', 'queued_dttm', 'try_number', - 'pool', 'log') + 'pool', 'log_url') can_delete = True page_size = 500 http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/bae76e81/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 905af11..864d888 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os import sys # Kept manually in sync with airflow.__version__ -version = '1.7.1' +version = '1.7.1.3' class Tox(TestCommand): @@ -123,7 +123,7 @@ def do_setup(): 'dill>=0.2.2, <0.3', 'python-daemon>=2.1.1, <2.2', 'flask>=0.10.1, <0.11', - 'flask-admin>=1.4.0, <2.0.0', + 'flask-admin==1.4.1', 'flask-cache>=0.13.1, <0.14', 'flask-login==0.2.11', 'future>=0.15.0, <0.16',
