You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by sa...@apache.org on 2016/11/15 07:36:54 UTC

incubator-airflow git commit: [AIRFLOW-533] Set autocommit via set_autocommit

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 12e48b4c6 -> f34b292f5


[AIRFLOW-533] Set autocommit via set_autocommit

 Delegate setting autocommit in insert_rows to set_autocommit

Closes #1813 from thyming/fix-insert-rows-
autocommit


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/f34b292f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/f34b292f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/f34b292f

Branch: refs/heads/master
Commit: f34b292f5889a6c155d967d1987e052e0bc92075
Parents: 12e48b4
Author: Luke Rohde <ro...@gmail.com>
Authored: Mon Nov 14 23:34:51 2016 -0800
Committer: Siddharth Anand <si...@yahoo.com>
Committed: Mon Nov 14 23:34:56 2016 -0800

----------------------------------------------------------------------
 airflow/hooks/dbapi_hook.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/f34b292f/airflow/hooks/dbapi_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/dbapi_hook.py b/airflow/hooks/dbapi_hook.py
index 939bae2..df52e54 100644
--- a/airflow/hooks/dbapi_hook.py
+++ b/airflow/hooks/dbapi_hook.py
@@ -203,10 +203,10 @@ class DbApiHook(BaseHook):
         else:
             target_fields = ''
         conn = self.get_conn()
-        cur = conn.cursor()
         if self.supports_autocommit:
-            cur.execute('SET autocommit = 0')
+            self.set_autocommit(conn, False)
         conn.commit()
+        cur = conn.cursor()
         i = 0
         for row in rows:
             i += 1