Skip to content

Commit

Permalink
[AIRFLOW-238] Make compatible with flask-admin 1.4.1
Browse files Browse the repository at this point in the history
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 apache#1588 on github
  • Loading branch information
mistercrunch authored and bolkedebruin committed Jun 14, 2016
1 parent a599167 commit 54b361d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion airflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
`airflow.www.login`
"""
from builtins import object
__version__ = "1.7.1.2"
__version__ = "1.7.1.3"

import logging
import os
Expand Down
16 changes: 6 additions & 10 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,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())

Expand Down Expand Up @@ -837,7 +832,7 @@ def log(self):
if ti:
host = ti.hostname
log_loaded = False

if os.path.exists(loc):
try:
f = open(loc)
Expand Down Expand Up @@ -2156,7 +2151,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,
Expand All @@ -2177,7 +2173,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

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger = logging.getLogger(__name__)

# Kept manually in sync with airflow.__version__
version = '1.7.1.2'
version = '1.7.1.3'


class Tox(TestCommand):
Expand Down Expand Up @@ -168,7 +168,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',
Expand Down

0 comments on commit 54b361d

Please sign in to comment.