From 95b2a16b552d530e53ace86f32459f4d225e5134 Mon Sep 17 00:00:00 2001 From: Drew Banin Date: Thu, 14 Dec 2017 13:46:50 -0500 Subject: [PATCH] Fixes already opened transaction issue For https://github.com/fishtown-analytics/dbt/issues/602 --- dbt/adapters/snowflake.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbt/adapters/snowflake.py b/dbt/adapters/snowflake.py index 801628e2dbc..431f1b1c33f 100644 --- a/dbt/adapters/snowflake.py +++ b/dbt/adapters/snowflake.py @@ -147,7 +147,11 @@ def add_begin_query(cls, profile, name): def create_schema(cls, profile, schema, model_name=None): logger.debug('Creating schema "%s".', schema) sql = cls.get_create_schema_sql(schema) - return cls.add_query(profile, sql, model_name, select_schema=False) + res = cls.add_query(profile, sql, model_name, select_schema=False) + + cls.commit_if_has_connection(profile, model_name) + + return res @classmethod def get_existing_schemas(cls, profile, model_name=None):