Repository: incubator-airflow
Updated Branches:
  refs/heads/master be3d551f7 -> dae8ac3d6


[AIRFLOW-2590] Fix commit in DbApiHook.run() for no-autocommit DB

Closes #3485 from yrqls21/kevin_yang_fix_dbapi


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

Branch: refs/heads/master
Commit: dae8ac3d630b1430ff26bc7dffffe95edd020256
Parents: be3d551
Author: Kevin Yang <[email protected]>
Authored: Tue Jun 12 01:25:40 2018 +0100
Committer: Kaxil Naik <[email protected]>
Committed: Tue Jun 12 01:25:40 2018 +0100

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


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/dae8ac3d/airflow/hooks/dbapi_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/dbapi_hook.py b/airflow/hooks/dbapi_hook.py
index 7031f6a..09dbb83 100644
--- a/airflow/hooks/dbapi_hook.py
+++ b/airflow/hooks/dbapi_hook.py
@@ -169,7 +169,8 @@ class DbApiHook(BaseHook):
                     else:
                         cur.execute(s)
 
-            should_commit = getattr(conn, 'autocommit', False)
+            should_commit = getattr(conn, 'autocommit',
+                                    False) or not self.supports_autocommit
 
             if should_commit:
                 conn.commit()

Reply via email to