From 1429658ec9001928c3a389618e2a4ea2b25b8ad1 Mon Sep 17 00:00:00 2001 From: Niklas Schmidtmer Date: Thu, 22 Dec 2022 07:48:23 +0100 Subject: [PATCH] Fix invalid `values` call for update statement 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 --- src/crate/client/sqlalchemy/tests/dict_test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/crate/client/sqlalchemy/tests/dict_test.py b/src/crate/client/sqlalchemy/tests/dict_test.py index dbec0eef..7db3f3d1 100644 --- a/src/crate/client/sqlalchemy/tests/dict_test.py +++ b/src/crate/client/sqlalchemy/tests/dict_test.py @@ -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