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 'superset db history' (#3948)
Date Thu, 30 Nov 2017 04:52:58 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 1ce14df  fix 'superset db history' (#3948)
1ce14df is described below

commit 1ce14df43de76f69776fbd2d7e94560ea5c10cad
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Wed Nov 29 20:52:56 2017 -0800

    fix 'superset db history' (#3948)
    
    * fix 'superset db history'
    
    Related Error msg when running `superset db history`:
    "NameError: Can't invoke function 'get_bind', as the proxy object has not
    yet been established for the Alembic 'Operations' class.  Try placing
    this code inside a callable."
    
    * Lint
---
 superset/migrations/versions/4736ec66ce19_.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/superset/migrations/versions/4736ec66ce19_.py b/superset/migrations/versions/4736ec66ce19_.py
index 2d560d5..de86a39 100644
--- a/superset/migrations/versions/4736ec66ce19_.py
+++ b/superset/migrations/versions/4736ec66ce19_.py
@@ -34,11 +34,10 @@ datasources = sa.Table(
     sa.Column('datasource_name', sa.String(255)),
 )
 
-bind = op.get_bind()
-insp = sa.engine.reflection.Inspector.from_engine(bind)
-
 
 def upgrade():
+    bind = op.get_bind()
+    insp = sa.engine.reflection.Inspector.from_engine(bind)
 
     # Add the new less restrictive uniqueness constraint.
     with op.batch_alter_table('datasources', naming_convention=conv) as batch_op:
@@ -114,6 +113,8 @@ def upgrade():
 
 
 def downgrade():
+    bind = op.get_bind()
+    insp = sa.engine.reflection.Inspector.from_engine(bind)
 
     # Add the new more restrictive uniqueness constraint which is required by
     # the foreign key constraints. Note this operation will fail if the

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message