Skip to content

Commit

Permalink
Fix invalid values call for update statement
Browse files Browse the repository at this point in the history
The previous statement generated a `BindParameter` that could not be serialized to JSON. This change switches to a Tuple that gets serialized successfully.
It throwed a `TypeError` when trying to serialize
  • Loading branch information
hammerhead committed Dec 22, 2022
1 parent 0038451 commit 1429658
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/crate/client/sqlalchemy/tests/dict_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ def test_update_with_dict_column(self):
mytable = self.mytable
stmt = mytable.update().\
where(mytable.c.name == 'Arthur Dent').\
values({
"data['x']": "Trillian"
})
values({mytable.c.data['x']: "Trillian"})
self.assertSQL(
"UPDATE mytable SET data['x'] = ? WHERE mytable.name = ?",
stmt
Expand Down

0 comments on commit 1429658

Please sign in to comment.