From b485becfd2b0c9316c3dec7df6a003de123a632c Mon Sep 17 00:00:00 2001 From: roc Date: Mon, 11 Jun 2018 11:07:23 +0800 Subject: [PATCH] [AIRFLOW-2591] Set default value of autocommit to False in DbApiHook.run() In previous PR (AIRFLOW-2581), I changed the default value of autocommit to True in DbApiHook.run(), which may cause some performance issues, so I changed it back to False. --- airflow/hooks/dbapi_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/hooks/dbapi_hook.py b/airflow/hooks/dbapi_hook.py index 8f83077d63d86..7031f6a0cb00a 100644 --- a/airflow/hooks/dbapi_hook.py +++ b/airflow/hooks/dbapi_hook.py @@ -137,7 +137,7 @@ def get_first(self, sql, parameters=None): cur.execute(sql) return cur.fetchone() - def run(self, sql, autocommit=True, parameters=None): + def run(self, sql, autocommit=False, parameters=None): """ Runs a command or a list of commands. Pass a list of sql statements to the sql parameter to get them to execute