You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/11/30 04:52:58 UTC

[incubator-superset] branch master updated: fix 'superset db history' (#3948)

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 <ma...@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" <co...@superset.apache.org>'].