Repository: incubator-airflow
Updated Branches:
  refs/heads/v1-10-test d96534c26 -> a935e11ac


[AIRFLOW-2365] Fix autocommit attribute check

Closes #3258 from artwr/awiedmer-fix-dbapi-test-
issue

(cherry picked from commit 813136f457b554561402b4a2510a2a4234f76b6a)
Signed-off-by: Bolke de Bruin <[email protected]>


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

Branch: refs/heads/v1-10-test
Commit: a935e11acd77f9e32ff12939b3c0fdd2fa22993b
Parents: d96534c
Author: Arthur Wiedmer <[email protected]>
Authored: Tue Apr 24 08:20:57 2018 +0200
Committer: Bolke de Bruin <[email protected]>
Committed: Tue Apr 24 08:22:13 2018 +0200

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


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a935e11a/airflow/hooks/dbapi_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/dbapi_hook.py b/airflow/hooks/dbapi_hook.py
index 304fbf9..70439e8 100644
--- a/airflow/hooks/dbapi_hook.py
+++ b/airflow/hooks/dbapi_hook.py
@@ -169,7 +169,7 @@ class DbApiHook(BaseHook):
                     else:
                         cur.execute(s)
 
-            if not conn.autocommit:
+            if not getattr(conn, 'autocommit', False):
                 conn.commit()
 
     def set_autocommit(self, conn, autocommit):

Reply via email to