superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] mistercrunch closed pull request #5415: Fix db migration 3dda56f1c4c6
Date Tue, 17 Jul 2018 22:30:20 GMT
mistercrunch closed pull request #5415: Fix db migration 3dda56f1c4c6
URL: https://github.com/apache/incubator-superset/pull/5415
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 8bb6f10068..c2a0d9af27 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 @@
 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]


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Mime
View raw message