diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-12-11 19:39:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-12-11 19:39:04 +0000 |
| commit | 8e9e473dcb76b57a7f0eaa476481cb66a258ea69 (patch) | |
| tree | 747ea77ecd32d7eb8b71d5d623aa95c511d91790 /lib/sqlalchemy/engine/base.py | |
| parent | 5bf2074ca2e80aed4ac38b5684d606cc939d4d8c (diff) | |
| parent | ba5cbf9366e9b2c5ed8e27e91815d7a2c3b63e41 (diff) | |
| download | sqlalchemy-8e9e473dcb76b57a7f0eaa476481cb66a258ea69.tar.gz | |
Merge "correct for "autocommit" deprecation warning"
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 9a5518a96..028af9fbb 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -840,7 +840,15 @@ class Connection(Connectable): def _commit_impl(self, autocommit=False): assert not self.__branch_from - if autocommit: + # AUTOCOMMIT isolation-level is a dialect-specific concept, however + # if a connection has this set as the isolation level, we can skip + # the "autocommit" warning as the operation will do "autocommit" + # in any case + if ( + autocommit + and self._execution_options.get("isolation_level", None) + != "AUTOCOMMIT" + ): util.warn_deprecated_20( "The current statement is being autocommitted using " "implicit autocommit, which will be removed in " @@ -2687,9 +2695,11 @@ class Engine(Connectable, log.Identified): self.pool = self.pool.recreate() self.dispatch.engine_disposed(self) - def _execute_default(self, default): + def _execute_default( + self, default, multiparams=(), params=util.EMPTY_DICT + ): with self.connect() as conn: - return conn._execute_default(default, (), {}) + return conn._execute_default(default, multiparams, params) @contextlib.contextmanager def _optional_conn_ctx_manager(self, connection=None): |
