superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fix db migration 3dda56f1c4c6 (#5415)
Date Tue, 17 Jul 2018 22:30:21 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 73ec526  Fix db migration 3dda56f1c4c6 (#5415)
73ec526 is described below

commit 73ec5269135ebf09559ff9ceb29e3290bea2c43c
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Tue Jul 17 15:30:18 2018 -0700

    Fix db migration 3dda56f1c4c6 (#5415)
---
 .../3dda56f1c4c6_migrate_num_period_compare_and_period_.py     | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

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 8bb6f10..c2a0d9a 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
@@ -9,18 +9,20 @@ Create Date: 2018-07-05 15:19:14.609299
 from __future__ import division
 
 # revision identifiers, used by Alembic.
-revision = '3dda56f1c4c6'
-down_revision = 'bddc498dd179'
 
+import datetime
 import json
 
 from alembic import op
 import isodate
-import sqlalchemy as sa
 from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy import Column, Integer, Text
 
 from superset import db
+from superset.utils import parse_human_timedelta
+
+revision = '3dda56f1c4c6'
+down_revision = 'bddc498dd179'
 
 
 Base = declarative_base()
@@ -96,6 +98,8 @@ def format_seconds(value):
 
 
 def compute_time_compare(granularity, periods):
+    if not granularity:
+        return None
     # convert old db_engine_spec granularity to ISO duration
     if granularity in db_engine_specs_map:
         granularity = db_engine_specs_map[granularity]


Mime
View raw message