python - CompileError: Unconsumed column names -
i have conditional takes care of updating or deleting model based on changes on model , operation.
if change.operation == 'update': db.query(model).filter_by(id=change.old_record_id).update(change.new) elif change.operation == 'delete': db.query(model).filter_by(id=change.old_record_id).delete() db.commit()
when code reaches point gives: sqlalchemy.exc:compileerror: unconsumed column names: subscribers
i declaring engine in function:
def make_session(connection_string): engine = create_engine(connection_string, echo=false, convert_unicode=true, pool_size=20, max_overflow=20) session = scoped_session(sessionmaker(bind=engine)) return session, engine
full traceback
the error points line 2 of example, update happens
file ".../site-packages/sqlalchemy/orm/query.py", line 2851, in update file ".../site-packages/sqlalchemy/orm/persistence.py", line 897, in exec_ file ".../site-packages/sqlalchemy/orm/persistence.py", line 995, in _do_exec file ".../site-packages/sqlalchemy/orm/session.py", line 1021, in execute file ".../site-packages/sqlalchemy/engine/base.py", line 841, in execute file ".../site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection file ".../site-packages/sqlalchemy/engine/base.py", line 931, in _execute_clauseelement file "<string>", line 1, in <lambda> file ".../site-packages/sqlalchemy/sql/elements.py", line 493, in compile file ".../site-packages/sqlalchemy/sql/elements.py", line 499, in _compiler file ".../site-packages/sqlalchemy/sql/compiler.py", line 395, in __init__ file ".../site-packages/sqlalchemy/sql/compiler.py", line 199, in __init__ file ".../site-packages/sqlalchemy/sql/compiler.py", line 222, in process file ".../site-packages/sqlalchemy/sql/visitors.py", line 80, in _compiler_dispatch file ".../site-packages/sqlalchemy/sql/compiler.py", line 1814, in visit_update file ".../site-packages/sqlalchemy/sql/compiler.py", line 2225, in _get_colparams
Comments
Post a Comment