diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-08-19 12:08:26 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-08-20 10:14:21 -0400 |
commit | a1939719a652774a437f69f8d4788b3f08650089 (patch) | |
tree | 309b7423fc4fa919af7af2bb9da81be824ccda87 /lib/sqlalchemy/testing/assertsql.py | |
parent | 0901190bb440580f0664fe3f6310173762b908e0 (diff) | |
download | sqlalchemy-a1939719a652774a437f69f8d4788b3f08650089.tar.gz |
normalize execute style for events, 2.0
The _execute_20 and exec_driver_sql methods should wrap
up the parameters so that they represent the single list / single
dictionary style of invocation into the legacy methods. then
the before_ after_ execute event handlers should be receiving
the parameter dictionary as a single dictionary. this requires
that we break out distill_params to work differently if event
handlers are present.
additionally, add deprecation warnings for old argument passing
styles.
Change-Id: I97cb4d06adfcc6b889f10d01cc7775925cffb116
Diffstat (limited to 'lib/sqlalchemy/testing/assertsql.py')
-rw-r--r-- | lib/sqlalchemy/testing/assertsql.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/testing/assertsql.py b/lib/sqlalchemy/testing/assertsql.py index caf61a806..0face5f8f 100644 --- a/lib/sqlalchemy/testing/assertsql.py +++ b/lib/sqlalchemy/testing/assertsql.py @@ -13,7 +13,7 @@ from .. import event from .. import util from ..engine import url from ..engine.default import DefaultDialect -from ..engine.util import _distill_params +from ..engine.util import _distill_cursor_params from ..schema import _DDLCompiles @@ -348,7 +348,9 @@ class SQLExecuteObserved(object): def __init__(self, context, clauseelement, multiparams, params): self.context = context self.clauseelement = clauseelement - self.parameters = _distill_params(multiparams, params) + self.parameters = _distill_cursor_params( + context.connection, tuple(multiparams), params + ) self.statements = [] def __repr__(self): |