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: [hotfix] resolve utf-8 encoding issue in db migration (#4461)
Date Thu, 22 Feb 2018 01:45:32 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 5830846  [hotfix] resolve utf-8 encoding issue in db migration (#4461)
5830846 is described below

commit 5830846060909fb5e01e8d7d174c6c7bf7c9b039
Author: timifasubaa <30888507+timifasubaa@users.noreply.github.com>
AuthorDate: Wed Feb 21 17:45:28 2018 -0800

    [hotfix] resolve utf-8 encoding issue in db migration (#4461)
    
    * [hotfix] resolve utf-8 encoding issue in db migration
    
    * make python string unicode
    
    * Update e866bd2d4976_smaller_grid.py
    
    * Update e866bd2d4976_smaller_grid.py
    
    * rearrange the debug message
    
    * Update e866bd2d4976_smaller_grid.py
---
 superset/migrations/versions/e866bd2d4976_smaller_grid.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset/migrations/versions/e866bd2d4976_smaller_grid.py b/superset/migrations/versions/e866bd2d4976_smaller_grid.py
index e99c703..ad996d4 100644
--- a/superset/migrations/versions/e866bd2d4976_smaller_grid.py
+++ b/superset/migrations/versions/e866bd2d4976_smaller_grid.py
@@ -32,6 +32,8 @@ def upgrade():
 
     dashboards = session.query(Dashboard).all()
     for i, dashboard in enumerate(dashboards):
+        print('Upgrading ({}/{}): {}'.format(
+            i, len(dashboards), dashboard.id))
         positions = json.loads(dashboard.position_json or '{}')
         for pos in positions:
             if pos.get('v', 0) == 0:
@@ -44,8 +46,6 @@ def upgrade():
         dashboard.position_json = json.dumps(positions, indent=2)
         session.merge(dashboard)
         session.commit()
-        print('Upgraded ({}/{}): {}'.format(
-            i, len(dashboards), dashboard.dashboard_title))
 
     session.close()
 
@@ -56,6 +56,8 @@ def downgrade():
 
     dashboards = session.query(Dashboard).all()
     for i, dashboard in enumerate(dashboards):
+        print('Downgrading ({}/{}): {}'.format(
+            i, len(dashboards), dashboard.id))
         positions = json.loads(dashboard.position_json or '{}')
         for pos in positions:
             if pos.get('v', 0) == 1:
@@ -68,6 +70,4 @@ def downgrade():
         dashboard.position_json = json.dumps(positions, indent=2)
         session.merge(dashboard)
         session.commit()
-        print('Downgraded ({}/{}): {}'.format(
-            i, len(dashboards), dashboard.dashboard_title))
     pass

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message