From a1939719a652774a437f69f8d4788b3f08650089 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 19 Aug 2020 12:08:26 -0400 Subject: 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 --- lib/sqlalchemy/testing/assertsql.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/testing/assertsql.py') 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): -- cgit v1.2.1