mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix RemovedIn20Warning: engine.execute() (note)
test/unit/data/model/test_mapping.py::TestCleanupEvent::test_table /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/view/utils.py:80: RemovedIn20Warning: The Engine.execute() method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) engine.execute(CreateView(view.name, view.__view__)) https://docs.sqlalchemy.org/en/14/changelog/migration_20.html#execute-method-more-strict-execution-options-are-more-prominent
This commit is contained in:
@@ -200,4 +200,5 @@ def execute_statements(engine, raw_sql):
|
||||
statements = raw_sql if isinstance(raw_sql, list) else [raw_sql]
|
||||
for sql in statements:
|
||||
cmd = DDL(sql)
|
||||
cmd.execute(bind=engine)
|
||||
with engine.connect() as connection:
|
||||
connection.execute(cmd)
|
||||
|
||||
Reference in New Issue
Block a user