Skip to content

Commit

Permalink
SA20: Fix SqlAlchemyInsertFromSelectTest
Browse files Browse the repository at this point in the history
By binding the insert clause to an engine, use the "qmark" paramstyle
again, instead of falling back to the "named" paramstyle of the default
dialect.
  • Loading branch information
amotl committed Dec 22, 2022
1 parent 603f31c commit a4454d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/crate/client/sqlalchemy/tests/insert_from_select_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def test_insert_from_select_triggered(self):
ins = insert(self.character_archived).from_select(['name', 'age'], sel)
self.session.execute(ins)
self.session.commit()
# TODO: Verify if this is correct.
self.assertSQL(
"INSERT INTO characters_archive (name, age) SELECT characters.name, characters.age FROM characters WHERE characters.status = :status_1",
ins
"INSERT INTO characters_archive (name, age) SELECT characters.name, characters.age FROM characters WHERE characters.status = ?",
ins.compile(bind=self.engine)
)

0 comments on commit a4454d5

Please sign in to comment.