From bea0a0aa1590d073365ecf74d75a054643dbe3b7 Mon Sep 17 00:00:00 2001 From: timifasubaa <30888507+timifasubaa@users.noreply.github.com> Date: Mon, 23 Jul 2018 16:27:41 -0700 Subject: [PATCH] fix migration 3dda56f1c (#5468) * fix migration 3dda56f1c * add isodate to setup.py: --- requirements.txt | 1 + setup.py | 1 + .../3dda56f1c4c6_migrate_num_period_compare_and_period_.py | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 80af3c7b7a2d2..b81e1789484b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,6 +17,7 @@ geopy==1.11.0 gunicorn==19.8.0 humanize==0.5.1 idna==2.6 +isodate==0.6.0 markdown==2.6.11 pandas==0.23.1 parsedatetime==2.0.0 diff --git a/setup.py b/setup.py index 8db1597c0c537..38c39a8921428 100644 --- a/setup.py +++ b/setup.py @@ -75,6 +75,7 @@ def get_git_sha(): 'gunicorn', # deprecated 'humanize', 'idna', + 'isodate', 'markdown', 'pandas>=0.18.0', 'parsedatetime', diff --git a/superset/migrations/versions/3dda56f1c4c6_migrate_num_period_compare_and_period_.py b/superset/migrations/versions/3dda56f1c4c6_migrate_num_period_compare_and_period_.py index c2a0d9af27962..fef8bb81a11d2 100644 --- a/superset/migrations/versions/3dda56f1c4c6_migrate_num_period_compare_and_period_.py +++ b/superset/migrations/versions/3dda56f1c4c6_migrate_num_period_compare_and_period_.py @@ -125,7 +125,7 @@ def upgrade(): session = db.Session(bind=bind) for chart in session.query(Slice): - params = json.loads(chart.params) + params = json.loads(chart.params or '{}') if not params.get('num_period_compare'): continue @@ -150,7 +150,7 @@ def downgrade(): session = db.Session(bind=bind) for chart in session.query(Slice): - params = json.loads(chart.params) + params = json.loads(chart.params or '{}') if 'time_compare' in params or 'comparison_type' in params: params.pop('time_compare', None)