Table.append_ddl_listener: listeners are passed keyword arguments
Issue #2206
resolved
In 0.7.x, the event system was changed and unfortunately this change broke the old DDL listener system which only expects three positional arguments:
from sqlalchemy import *
test = Table('test', MetaData(), Column('id', Integer, primary_key=True))
if __name__ == '__main__':
test.append_ddl_listener('after-create', lambda e, t, b: None)
engine = create_engine('sqlite://')
test.create(engine)
Results in the following:
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 474, in adapt_listener
listener(event_name, target, connection, **kw)
TypeError: <lambda>() got an unexpected keyword argument 'checkfirst'
This should not happen if the point was to maintain backwards compatibility with the old event system.
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.7.2 (automated comment)
- Log in to comment
that is a bug since that function is otherwise not used, added some coverage in fc4f7de0051334987326de1e74cd86d2a08e2e07.