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 01b5a09 commit efca25e
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 efca25e

Please sign in to comment.