Skip to content

Commit

Permalink
fix for commit/transaction error (#436)
Browse files Browse the repository at this point in the history
Tried to commit transaction on connection "{model}", but it does not have one open!
  • Loading branch information
drewbanin authored May 19, 2017
1 parent 02e8e66 commit 5f04aae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dbt/adapters/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def drop(cls, profile, relation, relation_type, model_name=None):

connection = cls.get_connection(profile, model_name)

cls.commit(connection)
if connection.get('transaction_open'):
cls.commit(connection)

cls.begin(profile, connection.get('name'))

to_return = super(PostgresAdapter, cls).drop(
Expand Down

0 comments on commit 5f04aae

Please sign in to comment.