- changed status to duplicate
named=True raises "unexpected argument" for Engine events
The events documentation notes that since 0.9, the listens_for event decorator accepts a keyword named
. With this, event arguments are provided as a dict. This works fine for the example of the Pool event, but fails for Engine events (for the current 0.9.7 release).
A testcase to reproduce this and traceback are included as attachments. The relevant code is also included below:
from sqlalchemy.event import listens_for
from sqlalchemy.engine import Engine
@listens_for(Engine, 'before_execute', named=True)
def intercept_execute(conn, **kw):
print conn.engine.url
Comments (4)
-
repo owner -
repo owner thanks, funny how these come in twos, adding this to
#3197's description as it's the same thing -
reporter Heh, I swear I used the search for this. Bitbucket does not want to play ball when you use more than one search term it seems.. "named events" comes up empty. Certainly similar enough to be a duplicate.
-
repo owner the search on BB sucks and the other issue only came up the other day so no worries!
- Log in to comment
Duplicate of
#3197.