Skip to content

Commit

Permalink
fix 'superset db history' (apache#3948)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mistercrunch authored and michellethomas committed May 23, 2018
1 parent 0ba0248 commit cd02c48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions superset/migrations/versions/4736ec66ce19_.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@
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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cd02c48

Please sign in to comment.